According to the heading, I do not understand how the following code can compile when has_type_struct<no_type>, of course, is an invalid type.
template<typename T>
using my_int = int;
struct no_type {};
template<typename T>
struct has_type_struct { using type = typename T::type; };
template<typename T>
using has_type_using = typename T::type;
int main() {
my_int<has_type_struct<no_type>> a;
return 0;
}
source
share