-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The setup before this commit violates the C++ standard. If two classes with non-standard constructors and/or destructors are in a union their constructors and/or destructors have to be called explicitly when switching between the value types. Using a union is also unsafe as it's illegal to access the "wrong" of the two members. But the API doesn't have a way to tell which member is the active. The new solution doesn't use unions but allows clients to safely access even the wrong value.
- Loading branch information
Showing
3 changed files
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters