fork(1) download
  1.  
  2. #include <list>
  3. int main()
  4. {
  5. class MemberType
  6. {
  7. public:
  8. MemberType() {}
  9. MemberType(MemberType&& copy)
  10. {
  11.  
  12. }
  13.  
  14. };
  15.  
  16. struct ListItemType
  17. {
  18. MemberType x;
  19.  
  20. ~ListItemType() {}
  21. };
  22.  
  23. std::list<ListItemType> myList;
  24. myList.push_back({MemberType()});
  25. return 0;
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
In file included from /usr/include/c++/5/list:63:0,
                 from prog.cpp:2:
/usr/include/c++/5/bits/stl_list.h: In instantiation of 'std::_List_node<_Tp>::_List_node(_Args&& ...) [with _Args = {main()::ListItemType}; _Tp = main()::ListItemType]':
/usr/include/c++/5/ext/new_allocator.h:120:4:   required from 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = std::_List_node<main()::ListItemType>; _Args = {main()::ListItemType}; _Tp = std::_List_node<main()::ListItemType>]'
/usr/include/c++/5/bits/stl_list.h:574:8:   required from 'std::list<_Tp, _Alloc>::_Node* std::list<_Tp, _Alloc>::_M_create_node(_Args&& ...) [with _Args = {main()::ListItemType}; _Tp = main()::ListItemType; _Alloc = std::allocator<main()::ListItemType>; std::list<_Tp, _Alloc>::_Node = std::_List_node<main()::ListItemType>]'
/usr/include/c++/5/bits/stl_list.h:1763:32:   required from 'void std::list<_Tp, _Alloc>::_M_insert(std::list<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {main()::ListItemType}; _Tp = main()::ListItemType; _Alloc = std::allocator<main()::ListItemType>; std::list<_Tp, _Alloc>::iterator = std::_List_iterator<main()::ListItemType>]'
/usr/include/c++/5/bits/stl_list.h:1094:9:   required from 'void std::list<_Tp, _Alloc>::push_back(std::list<_Tp, _Alloc>::value_type&&) [with _Tp = main()::ListItemType; _Alloc = std::allocator<main()::ListItemType>; std::list<_Tp, _Alloc>::value_type = main()::ListItemType]'
prog.cpp:24:33:   required from here
/usr/include/c++/5/bits/stl_list.h:114:71: error: use of deleted function 'main()::ListItemType::ListItemType(const main()::ListItemType&)'
  : __detail::_List_node_base(), _M_data(std::forward<_Args>(__args)...) 
                                                                       ^
prog.cpp:16:9: note: 'main()::ListItemType::ListItemType(const main()::ListItemType&)' is implicitly deleted because the default definition would be ill-formed:
  struct ListItemType
         ^
prog.cpp:16:9: error: use of deleted function 'constexpr main()::MemberType::MemberType(const main()::MemberType&)'
prog.cpp:5:8: note: 'constexpr main()::MemberType::MemberType(const main()::MemberType&)' is implicitly declared as deleted because 'main()::MemberType' declares a move constructor or move assignment operator
  class MemberType
        ^
stdout
Standard output is empty