SFINAE with std::enable_if and std::is_default_constructible for incomplete type in libc++
问题 I just observed a strange issue with libc++ when using SFINAE to detect if a templated type is default constructible. The following is a minimal example I was able to come up with: #include <iostream> #include <type_traits> template <typename T> struct Dummy; template <> struct Dummy<int>{}; template <typename T, typename = void> struct has_dummy : std::false_type {}; template <typename T> struct has_dummy<C, std::enable_if_t<std::is_default_constructible<Dummy<T>>::value>> : std::true_type{}