fork(2) download
  1.  
  2. class Test
  3. {
  4. public:
  5. template<typename T, typename U = T>
  6. operator U()
  7. {
  8. return U();
  9. }
  10. };
  11. class Test1{};
  12.  
  13. int main() {
  14. Test t;
  15. Test1 t1 = (Test1)t;
  16.  
  17. return 0;
  18. }
  19.  
Compilation error #stdin compilation error #stdout 0s 3452KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:15:20: error: no matching function for call to 'Test1::Test1(Test&)'
  Test1 t1 = (Test1)t;
                    ^
prog.cpp:11:7: note: candidate: constexpr Test1::Test1()
 class Test1{};
       ^
prog.cpp:11:7: note:   candidate expects 0 arguments, 1 provided
prog.cpp:11:7: note: candidate: constexpr Test1::Test1(const Test1&)
prog.cpp:11:7: note:   no known conversion for argument 1 from 'Test' to 'const Test1&'
prog.cpp:11:7: note: candidate: constexpr Test1::Test1(Test1&&)
prog.cpp:11:7: note:   no known conversion for argument 1 from 'Test' to 'Test1&&'
stdout
Standard output is empty