c++ - Passing template parameters to base class, concise notation -
is there more consice way pass parameters base template class?
template <class ii, class ici> class graphbase : public graphbaseofbase<ii, ici> { ... }; template <> class graphbase<std::vector<int>::iterator, std::vector<int>::const_iterator> : public graphbaseofbase< std::vector<int>::iterator, std::vector<int>::const_iterator> { ... };
you might use using
shorten primary types used, like:
using vec_it = typename std::vector<int>::iterator; using vec_cit = std::vector<int>::iterator;
and then
template <> class graphbase : public graphbaseofbase<vec_it, vec_cit> { //... };
Comments
Post a Comment