fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Foo {
  5.  
  6. template <typename U>
  7. Foo(U&& i) : i(i){}
  8.  
  9. Foo(Foo& rhs) {
  10. std::cout <<"copy";
  11. }
  12.  
  13. int i;
  14. };
  15.  
  16. int main() {
  17.  
  18. Foo f(42);
  19. auto f2(f);
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 4384KB
stdin
Standard input is empty
stdout
copy