08/07/17 22:57:57
>>819
テンプレートクラスを使わずに普通のクラスで対処したらいけないの?
class list { /* listの定義 */ };;
class IntegerList : public list { /* IntegerListの定義 */ };
class DoubleList : public list { /* DoubleListの定義 */ };
list* getList(int n) {
if ( n == 1 ) { return new IntegerList(); }
if ( n == 2 ) { return new DoubleList(); }
}