fork download
  1. #include <tuple>
  2. template< class X > struct Hold {
  3. X x;
  4. constexpr Hold( X x ) : x(std::move(x)) { }
  5. };
  6. constexpr auto a = Hold<int>( 1 ); //ok
  7. constexpr auto b = Hold<std::tuple<int>>( std::tuple<int>(1) ); // not
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In constructor 'Hold<X>::Hold(X) [with X = std::tuple<int>]':
prog.cpp:7:62:   instantiated from here
prog.cpp:4:12: error: parameter 'std::tuple<int> x' is not of literal type
prog.cpp: In constructor 'Hold<X>::Hold(X) [with X = std::tuple<int>]':
prog.cpp:4:44:   instantiated from 'Hold<X>::Hold(X) [with X = std::tuple<int>]'
prog.cpp:7:62:   instantiated from here
prog.cpp:4:44: error: parameter 'std::tuple<int>& __restrict__ x' is not of literal type
prog.cpp: In constructor 'Hold<X>::Hold(X) [with X = std::tuple<int>]':
prog.cpp:4:44:   instantiated from 'Hold<X>::Hold(X) [with X = std::tuple<int>]'
prog.cpp:7:62:   instantiated from here
prog.cpp:4:44: error: parameter 'std::tuple<int>& __restrict__ x' is not of literal type
stdout
Standard output is empty