「関数宣言でのテンプレートキーワードの使用」とはどういう意味ですか?
この例では、コンパイラエラーでエラーが発生します:「func」はテンプレート関数ではありません。
template<typename T>
struct Window {
T value;
};
template void func(Window<int>, int);
template<typename T>
void func(Window<T>, T) {
}
int main(void) {
}
しかし、以下の例は問題ありません。
template<typename T>
struct Window {
T value;
};
template<typename T>
void func(Window<T>, T) {
}
template void func(Window<int>, int);
int main(void) {
}
上記の場合の「テンプレート」の意味は何ですか?この関数がテンプレート関数であることを示しているだけですか?