mardi 25 octobre 2016

static assert to check map, set, unordered_map, unordered_set

I am writing a function where I am copying Keys of map, set, unordered_map, unordered_set to a vector, now I want to add a compile time assert to get clear error if some try to pass a vector, list in that function.

template <typename container>
auto CopyKeyToVector(conatiner c)
{
  //static assert to check c is map, unordered map only?


}

Any idea how we can do that- as map, unordered_map itself templatized container

Aucun commentaire:

Enregistrer un commentaire