fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template<typename T>
  5. void myprint(T thing)
  6. {
  7. static unsigned long index = 0;
  8. cout << (index++);
  9. cout << (": ");
  10. cout << ((thing));
  11. }
  12.  
  13. int main() {
  14. myprint("text");
  15. myprint(42);
  16. return 0;
  17. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
0: text0: 42