【C++】template 統合スレ -- Part5
■ このスレッドは過去ログ倉庫に格納されています
0873デフォルトの名無しさん
NGNGclass Hoge{
};
typedef boost::shared_ptr<Hoge*> pHoge;
class Mage : public Hoge{
vector<pHoge> array;
public:
Mage(){
pHoge o( this );
array.push_back( o );
for( int i = 0; i < 3; i++ ){
pHoge buf( new Hoge );
array.push_back( buf );
}
}
~Mage(){
array.clear();
}
};
が、>テンプレート引数がHoge*なのもおかしい というのはなぜでしょうか?
Mageに継承されたHoge自身を array の先頭に格納し、
後々 pHoge buf( new Hoge ); のように
別のデータを追加していきたいと考えているのですが…
■ このスレッドは過去ログ倉庫に格納されています