在另一个类模板中使用类模板

时间:2020-06-05 21:13:26

标签: c++ templates

假设我在某些文件中使用了类似以下模板的类:

:w

我想创建另一个可以使用任何先前类的模板化类。
像这样的东西:

    // PointerTemplates.hpp    

    template <class T>
    class Smart_Ptr_A
    {
      // [...]
    };

    template <class T>
    class Smart_Ptr_B
    {
      // [...]
    };

我该怎么做?

1 个答案:

答案 0 :(得分:3)

您将需要使用template template parameter

react
相关问题