0

std::tuple の単なるラッパーである可変個引数テンプレート クラスがあります。

template <typename ... Child>
class Tpl
{
public:
    Tpl() {}
    Tpl(Child ...args) : child(args...)
    {}

    template <typename T>
    T& Get()
    {
        return std::get<T>(child);
    }

    template <typename T>
    const T& GetConst()
    {
        return std::get<T>(child);
    }
private:
    std::tuple<Child ...> child;
};

からクラスを正しく派生させるにはどうすればよいTplですか?

template <typename... Ts>
class SomeObject : public Tpl<Ts...>
{
public:
    SomeObject(/*Types ... args*/) /*: child(args...)*/
    {

    }
private:
    int num;        
};

コンパイラ (VS14 CTP 6) のメッセージは次のように表示されます。

syntax error: missing ',' before '<' in the line: class SomeObject: public Tpl<Ts...>
4

1 に答える 1