vendredi 26 mars 2021

c++ multiple template template parameter

I'm reading some references online and I'm confused about template template argument. In particular I do not understand how the inner template parameter are passed according to their position. Perhaps an example will help to understand what is my confusion

What I was trying to do is the following. I have

template <typename A, typename B, typename DepA, typename DepB>
class aClass {
   ...
};

What I exect is that DepA must have A as template argument and DepB, B. In this way I would like to recast

aClass<int, double, std::vector<int>, std::deque<double>>

simply to

aClass<int, double, std::vector, std::deque>

What should I write in my template definition?

Aucun commentaire:

Enregistrer un commentaire