fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct hoge
  5. {
  6. template<int N>
  7. void operator ()() const
  8. {
  9. cout << N << endl;
  10. }
  11. };
  12.  
  13. template<class T>
  14. void f(T const & t)
  15. {
  16. t.template operator ()<1>();
  17. }
  18.  
  19. int main() {
  20. f(hoge());
  21. return 0;
  22. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
1