I would like to have a template class that wraps a container, but I would like to make a choice of which container to wrap according to the value of the template parameter. Something like:
template<typename T>
class A{
std::vector<T> MyContainer;
// ...
}
template<>
class A<bool>{
std::deque<bool> MyContainer;
// ...
}
but avoiding all the code duplication that template specialization involves. I was trying to see if std::enable_if
could help me to do some trick but I haven't figured any way.