Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- union S
- {
- std::string str;
- std::vector<int> vec;
- ~S() {} // needs to know which member is active, only possible in union-like class
- }; // the whole union occupies max(sizeof(string), sizeof(vector<int>))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement