fork(1) download
  1.  
  2. #include <utility>
  3.  
  4. struct Test {
  5. Test() : a(1.0) {}
  6.  
  7. private:
  8. double a;
  9. Test(Test&&) = default;
  10. Test(const Test&) = delete;
  11. void operator=(Test&&) = delete;
  12. };
  13.  
  14. int main (int argc, char** argv) {
  15. std::pair<Test, double> result(Test(), 0.0);
  16. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/include/c++/5/bits/stl_pair.h: In instantiation of 'constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&) [with _U2 = double; <template-parameter-2-2> = void; _T1 = Test; _T2 = double]':
prog.cpp:15:45:   required from here
prog.cpp:10:3: error: 'Test::Test(const Test&)' is private
   Test(const Test&) = delete;
   ^
In file included from /usr/include/c++/5/utility:70:0,
                 from prog.cpp:2:
/usr/include/c++/5/bits/stl_pair.h:139:45: error: within this context
  : first(__x), second(std::forward<_U2>(__y)) { }
                                             ^
/usr/include/c++/5/bits/stl_pair.h:139:45: error: use of deleted function 'Test::Test(const Test&)'
prog.cpp:10:3: note: declared here
   Test(const Test&) = delete;
   ^
stdout
Standard output is empty