I have an array std::vector<int> and an enum class Foo : int. Is there a better way to cast or convert than a reinterpret_cast?
std::vector<int>
enum class Foo : int
reinterpret_cast
std::vector<int> v; auto& c = *reinterpret_cast<std::vector<Foo>*>(&v);
Aucun commentaire:
Enregistrer un commentaire