我有一个带有 3 个参数的模板类,我需要先绑定(bind)其中的 2 个,然后将绑定(bind)的版本传递给我继承自的“父”模板模板类
。(我已经搜索过以前提出的问题,但没有人试图从父级继承。)
我怎样才能让它发挥作用?
这是一个示例代码:
template <> class W, class ...D>
struct Parent{};
template
struct Arg{};
template
struct Bind{
template
using arg = Arg;
};
template
struct DD : public Parent<>::t, D...> //compiler complains*
{ };
* template argument for template template parameter must be a class template or type alias template.
我试过使用 typename
关键字;并在 Binder
中使用 struct
继承而不是 using 指令
,但均无效。
Tôi là một lập trình viên xuất sắc, rất giỏi!