fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct Bar {};
  5. template<typename T>
  6. struct Foo {
  7.  
  8. template<typename T2>
  9. Foo(const T2& f) {
  10. cout << "A\n";
  11. }
  12.  
  13. template<typename T2>
  14. Foo(T2&& f) {
  15. cout << "B\n";
  16. }
  17. };
  18.  
  19. int main() {
  20. Foo<Bar>{Bar()};
  21. Bar b;
  22. Foo<Bar>{b};
  23. return 0;
  24. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
B
B