Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. union S
  2. {
  3. std::string str;
  4. std::vector<int> vec;
  5. ~S() {} // needs to know which member is active, only possible in union-like class
  6. }; // the whole union occupies max(sizeof(string), sizeof(vector<int>))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement