docs(cpp11): add STL real-world case and exercise mapping for 16-generalized-unions#57
Open
lczllx wants to merge 2 commits into
Open
docs(cpp11): add STL real-world case and exercise mapping for 16-generalized-unions#57lczllx wants to merge 2 commits into
lczllx wants to merge 2 commits into
Conversation
…ralized-unions - add section 二 真实案例 — include std::variant _Variant_storage_ and std::any _Storage_t examples, both cited from vendored msvc-stl/ - fill in 四 练习代码 — exercise descriptions, file links and d2x checker command - fix empty Code link in header table Case selection notes: Picked _Variant_storage_ over std::optional _Optional_destruct_base because the variant recursive union demonstrates both key C++11 generalized-union capabilities — non-trivial members and manual destructor management — while the optional pattern is effectively a special case of variant. std::any adds a second typical use: union as type-erased storage. Both are directly traceable in the vendored msvc-stl/, consistent with how ch00 cites xutility.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs(cpp11): add STL real-world case and exercise mapping for 16-generalized-unions
add section 二 真实案例 — include std::variant Variant_storage and
std::any _Storage_t examples, both cited from vendored msvc-stl/
fill in 四 练习代码 — exercise descriptions, file links and
d2x checker command
fix empty Code link in header table
Case selection notes:
Picked Variant_storage over std::optional _Optional_destruct_base
because the variant recursive union demonstrates both key C++11
generalized-union capabilities — non-trivial members and manual
destructor management — while the optional pattern is effectively
a special case of variant. std::any adds a second typical use:
union as type-erased storage. Both are directly traceable in the
vendored msvc-stl/, consistent with how ch00 cites xutility.