プログラム:
#include <iostream>
#include <type_traits>
template <class C>
struct tmpl
{
};
int main(int, char*[])
{
std::cout << std::is_class<tmpl<int> >::value << std::endl;
std::cout << std::is_class<tmpl<char> >::value << std::endl;
return 0;
}
出力:
1
1
しかし、私はコンパイラがテンプレートクラスtmpl<int>
とtmpl<char>
まだインスタンス化されていないことを理解して出力したいと思っています0
。出来ますか?私の例で実際にクラス テンプレートtmpl
をインスタンス化しましたか?