- C++相談室 part112
473 :デフォルトの名無しさん[sage]:2014/05/11(日) 02:17:16.93 ID:gNTTQA8W - >>472
そりゃtemplateの型が違うもん通らないでしょ intとsize_tどちらかに合わせなきゃ #include <iostream> using namespace std; template <size_t N> class int_to_type { static const int _N = N; }; struct hoge { template <size_t N> int operator ()(int_to_type<N>) { cout << N << endl; return 0; } }; int main() { // your code goes here hoge Hoge; Hoge(int_to_type<2>()); return 0; }
|
|