fork(2) download
  1. #include <iostream>
  2.  
  3. struct ostream {} cout;
  4. template<typename T> struct A{ T t; };
  5. struct B{};
  6.  
  7. namespace {
  8. template<typename T>
  9. ostream& operator<< (ostream& out, const A<T>&v)
  10. { return out << v.t; }
  11.  
  12. ostream& operator<< (ostream& out, const B&)
  13. { std::cout << "This should not compile"; return out; }
  14. }
  15.  
  16. int main(){
  17. A<B> a;
  18. cout << a;
  19. }
Success #stdin #stdout 0s 3096KB
stdin
Standard input is empty
stdout
This should not compile