fork download
  1. template <class T> struct B;
  2.  
  3. template <class T> B<T> operator+(const B<T>&);
  4.  
  5. template <class T>
  6. struct A {
  7. friend B<T> operator+<T>(const B<T>&);
  8. };
  9.  
  10. template <class T>
  11. struct B
  12. {
  13. B() {}
  14. B(const A<T>&) {}
  15. friend B operator+<T>(const B&);
  16. };
  17.  
  18. template <class T> B<T> operator+(const B<T>&)
  19. {
  20. return B<T>();
  21. }
  22.  
  23. int main()
  24. {
  25. A<int> a;
  26. B<int> b;
  27. +b;
  28. }
  29.  
  30.  
Success #stdin #stdout 0s 3452KB
stdin
Standard input is empty
stdout
Standard output is empty