C++相談室 part84
■ このスレッドは過去ログ倉庫に格納されています
0754デフォルトの名無しさん
2010/10/06(水) 20:35:04こんな感じ?
template <typename A> class TEST {
std::vector<A> test;
int call();
};
struct HOGE { int data; };
struct ABC { int width; int height; };
template <> int TEST<int>::call() { return test[0]; };
template <> int TEST<double>::call() { return (int) test[0]; };
template <> int TEST<HOGE>::call() { return test[0].data; };
template <> int TEST<ABC>::call() { return test[0].width; };
■ このスレッドは過去ログ倉庫に格納されています