fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class mah_class
  5. {
  6. public:
  7. template <class T>
  8. void operator<<(const T & t )
  9. {
  10. t( *this );
  11. }
  12. };
  13.  
  14. void func( mah_class & c )
  15. {
  16. //do something useful with c
  17. std::cout << "test";
  18. }
  19.  
  20. int main() {
  21. mah_class c;
  22. c<<func;
  23. return 0;
  24. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
test