jeudi 4 février 2016

How to write a function that returns a variadic template? Is that even right thing to do?

template <typename... Args>
Args... func3()   // error here -> Syntactical failure at Args...
{
    return (1,2,3,4,5,6);
}

struct sample
{
    template <typename... Args>
    sample(Args... args) {}
};

sample s(func3());

I get a compilation error upon running this piece of code. Is this fixable? If not, how can i re-write?

Aucun commentaire:

Enregistrer un commentaire