This question already has an answer here:
Given:
class foo_t { };
template<class ... args_t> class bar_t
{
static_assert(/*fire if foo_t is not part of args_t*/);
};
bar_t<foo_t, int, std::string> bar1; // ok
bar_t<char> bar2; // triggers static_assert above
How one can implement a static_assert in question?
Aucun commentaire:
Enregistrer un commentaire