C++相談室 part78
■ このスレッドは過去ログ倉庫に格納されています
0896デフォルトの名無しさん
2010/03/14(日) 19:32:55class TypeA{};
class TypeB{};
class hoge :public TypeA
{
};
class fuga :public TypeB
{
};
template<class T>
void func(const T& obj,typename boost::enable_if<boost::is_convertible<T*,TypeA*>>:type* =0)
{
}
template<class T>
void func(const T& obj,typename boost::enable_if<boost::is_convertible<T*,TypeB*>>:type* =0)
{
}
void test()
{
hoge h;
fuga f;
func(h);
func(f);
}
■ このスレッドは過去ログ倉庫に格納されています