- 345 名前:デフォルトの名無しさん mailto:sage [05/02/24 14:00:35 ]
- テンプレートの特殊化ってどこに書きますか?
以下のように特殊化する型の定義と一緒に書くと、 * primary.h #include <iostream> template <class T> inline void foo(const T&) { std::cout << "primary\n"; } --- * specialized.h #include "primary.h" struct bar {}; template <> inline void foo(const bar&) { std::cout << "specialized\n"; } --- * troublesome.h struct bar; bar& get_bar();
|

|