テンプレート化されたクラスへのプライベート メンバー ポインターを持つクラスを定義しています。そのようなクラスの設計について質問があります。より正確には、外部クラスをテンプレート化する必要があるかどうか。外部クラスのコンストラクターでプライベートメンバーを初期化しているので、そうするのが正しいと思います。他の選択肢はありますか?クラス宣言の例を以下に示します。すべての提案を歓迎します。
 #include <foo.h>
 #include <bar.h>
 template < class FOO_TYPE, class BAR_TYPE >
 class OuterClass{
     public:
        OuterClass(){
           this->m_pFoo   = new CFoo<FOO_TYPE>();
           this->m_pBar   = new CBar<BAR_TYPE>();
           this->m_nMyInt = 0;
        }
        template < class FOO_TYPE >
        CFoo<FOO_TYPE> * processFoo();
        template < class BAR_TYPE >
        CBar<BAR_TYPE> * processBar();
        ~OuterClass(){
           delete this->m_pFoo;
           delete this->m_pBar;
        }
     private:
        int m_nMyInt;
        CFoo<FOO_TYPE> * m_pFoo;
        CBar<BAR_TYPE> * m_pBar;
 };