- C++相談室 part117 [転載禁止]©2ch.net
31 :デフォルトの名無しさん[sage]:2015/05/16(土) 01:58:40.73 ID:jUULRVoQ - 例:
a.cpp: template<class T> void foo(T x) { printf("func_a: x=%d\n", x); } void bar(int x) { foo(x); } b.cpp template<class T> void foo(T x) { printf("func_b: x=%d\n", x); } void bar(int x) { foo(x); } みたいなケースでテンプレート関数fooをファイルスコープにしたいのですが やっぱnamespace使うしか無いですかね…
|