fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T> struct Foo{};
  5.  
  6. template <typename S> struct Bar
  7. {
  8. template <typename T> operator Foo<T>() { return Foo<T>{}; }
  9. };
  10.  
  11. class Baz
  12. {
  13. public:
  14. Baz(const Foo<int>&){}
  15. };
  16.  
  17. int main()
  18. {
  19. Bar<float> bar;
  20. Baz baz(bar); // works fine
  21. }
Success #stdin #stdout 0s 3136KB
stdin
Standard input is empty
stdout
Standard output is empty