For example
template<class Container, class List>
bool isEqual(Container const& c, List const& l)
{
return c == Container(l); // Error!!
}
And check by
std::vector<int> v;
bool b = isEqual(v, {1, 2, 3});
But error in my code. No conversion from list to container. How to fix the bug?
Aucun commentaire:
Enregistrer un commentaire