The question is easy to explain in code.
I have coded several template classes that they derive from a unique template class:
template<typename T,unsigned N>
struct DElem :
public BElem<T>
{};
My problem arises when I have to code a container of these anterior derived types from a container of the base class:
template<typename T, unsigned N>
struct DContainer<DElem<T,N>> :
public BContainer<BElem<T>>
{};
In my concrete case, Container could be std::tuple or std::array.
My first approximation is:
template<typename T, T B, std::size_t N>
struct DContainer :
public std::array<BElem<T>,N>
{
// This container is to hold **DElem<T,B>**
//
// This class has to do a cast for every
//
// **DElem<T,B>** (that is what the DContainer holds)
//
// to **BElem\<T\>**
//
// *If this task is easy I don't found the way*
};
Someone has an idea to do these tasks more easy or some other design more appropiate?