2 // { dg-do compile { target c++11 } }
4 template< class T, T v >
5 struct integral_constant
7 using type = integral_constant<T,v>;
9 static constexpr T value = v;
10 constexpr operator T ( ) noexcept { return value; }
13 using true_type = integral_constant<bool, true>;
14 using false_type = integral_constant<bool, false>;
16 template< bool b, class T = void > struct enable_if { using type = T; };
17 template< class T > struct enable_if<false, T> { };
21 class = typename enable_if< true_type{} // should compile; doesn't
24 T try_it( ) { return T{}; }
28 static_assert( true_type{} , "failed test 1!" );
29 static_assert( true_type{} , "failed test 2!" );
30 static_assert( ! false_type{} , "failed test 3!" );
31 static_assert( !! true_type{} , "failed test 4!" );