fork download
  1. #include <iostream>
  2.  
  3. template<typename T, typename K>
  4. struct A{
  5. template<typename L>
  6. friend std::ostream& operator<<(std::ostream& out, L const &x);
  7. };
  8.  
  9. template<typename T>
  10. std::ostream& operator<<(std::ostream& out, T const &x) {
  11. (void) x; // to silent the compiler
  12. // ...
  13. return out;
  14. }
  15.  
  16. int main(){
  17. A<int, int> i;
  18. A<double, int> j;
  19.  
  20. (void)i;
  21. (void)j;
  22. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty