fork download
  1. #include <iostream>
  2.  
  3. template<int X>
  4. struct b {
  5. int _y;
  6. b(int y) : _y(y) {}
  7. };
  8.  
  9. template<int X>
  10. std::ostream & operator<<(std::ostream &os, const b<X>& p)
  11. {
  12. return os << p._y;
  13. }
  14.  
  15. int main() {
  16. int a = 0;
  17. std::cout << (a<1>(2)) << std::endl;
  18. std::cout << (b<1>(2)) << std::endl;
  19. return 0;
  20. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
0
2