3 ms·
C unions dont work in C++ in most cases, because you can only have trivially constructible members in a union. So literally everything except primitives is out.
by lionkor 2y ago
C unions dont work in C++ in most cases, because you can only have trivially constructible members in a union. So literally everything except primitives is out. "std::variant and the 12 ways to implement the visitor pattern" sounds like a book title, but is actually just the reality of writing C++