DEV Community

Discussion on: Getting Cozy With C++

Collapse
 
deciduously profile image
Ben Lovy

Ah, that makes sense - I've been using std::variant. Seems like unions are most useful for interior with C that uses them.

Collapse
 
pgradot profile image
Pierre Gradot • Edited

As of C++17, you should use std::variant instead of plain old unions :)