mercredi 31 janvier 2018

C++ tuple of vectors, create tuple from elements by index

I've got a template class, that has tuple, filled by vectors.

template<typename ...Ts>
class MyClass
{
    public:
        std::tuple<std::vector<Ts>...> vectors;
};

I want to get new tuple filled by vectors element on the specified index.

template<typename ...Ts>
class MyClass
{
public:
    std::tuple<std::vector<Ts>...> vectors;

    std::tuple<Ts...> elements(int index)
    {
        // How can I do this?
    }
};

Is this even possible?

Aucun commentaire:

Enregistrer un commentaire