fork(1) download
  1. #include <iostream>
  2. #include <type_traits>
  3.  
  4. struct A {
  5. int m;
  6. };
  7.  
  8. struct B {
  9. B(const B&) {}
  10. };
  11.  
  12. struct C {
  13. virtual void foo();
  14. };
  15.  
  16. int main()
  17. {
  18. std::cout << std::boolalpha;
  19. std::cout << std::is_trivially_copyable<A>::value << '\n';
  20. std::cout << std::is_trivially_copyable<B>::value << '\n';
  21. std::cout << std::is_trivially_copyable<C>::value << '\n';
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:19:18: error: 'is_trivially_copyable' is not a member of 'std'
     std::cout << std::is_trivially_copyable<A>::value << '\n';
                  ^
prog.cpp:19:46: error: expected primary-expression before '>' token
     std::cout << std::is_trivially_copyable<A>::value << '\n';
                                              ^
prog.cpp:19:47: error: '::value' has not been declared
     std::cout << std::is_trivially_copyable<A>::value << '\n';
                                               ^
prog.cpp:20:18: error: 'is_trivially_copyable' is not a member of 'std'
     std::cout << std::is_trivially_copyable<B>::value << '\n';
                  ^
prog.cpp:20:46: error: expected primary-expression before '>' token
     std::cout << std::is_trivially_copyable<B>::value << '\n';
                                              ^
prog.cpp:20:47: error: '::value' has not been declared
     std::cout << std::is_trivially_copyable<B>::value << '\n';
                                               ^
prog.cpp:21:18: error: 'is_trivially_copyable' is not a member of 'std'
     std::cout << std::is_trivially_copyable<C>::value << '\n';
                  ^
prog.cpp:21:46: error: expected primary-expression before '>' token
     std::cout << std::is_trivially_copyable<C>::value << '\n';
                                              ^
prog.cpp:21:47: error: '::value' has not been declared
     std::cout << std::is_trivially_copyable<C>::value << '\n';
                                               ^
stdout
Standard output is empty