lundi 11 janvier 2021

How could use Template Class for a container of container?

I want to use my class with the template. in main:

int main(void)
{
   HexAdapter<vector> foo;
   // maybe?
   // HexAdapter<vector<Cell>> foo;

   return 0;

}

I tried something like this

template <typename T>
class HexAdapter
{
public:
    HexAdapter();

private:
    T<T<Cell>> hexCells;

};

For the reason of this, Normally I used like this vector<vector<Cell>> hexCells But I want to work with all STL Containers with random access iterator.

Aucun commentaire:

Enregistrer un commentaire