C++相談室 part62
..
821:デフォルトの名無しさん
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(); }
}
次ページ続きを表示1を表示最新レス表示スレッドの検索類似スレ一覧話題のニュースおまかせリスト▼オプションを表示暇つぶし2ch
4766日前に更新/209 KB
担当:undef