I have a simple test program here which outputs a different result when compiling on gcc-4.9.3
and gcc-5.1
#include <iostream>
template< class... >
using void_t = void;
template<class, class = void_t<>>
struct has_member_type : std::false_type
{ };
template<class T>
struct has_member_type<T, void_t<typename T::type>> : std::true_type
{ };
int main()
{
std::cout << has_member_type<int>::value << '\n';
return 0;
}
gcc-4.9.3
output:
1
gcc-5.1
output:
0
I've been unable to find an online compiler which allows me to compile with two different compiler versions.
However, I have found two separate online compilers which have difference compiler versions:
- Here is the code compiled with
gcc-4.9.3
(rextester) - Here is the code compiled with
gcc-5.1
(ideone)
Question:
- Why does
gcc-4.9.3
output1
when there is clearly no memberint::type
?