lundi 18 février 2019

How to ensure that initializer_list is not zero

I have a constructor that accepts a initializer_list as argument:

A::A(std::initializer_list<uint32_t> arg)
    : vec(arg)
{
}

The issue is that it allows initializer_list zero or empty values for arg:

A {}

How can I force a non-zero initializer_list ?

Aucun commentaire:

Enregistrer un commentaire