Add std::pair specializations for trivial type traits#64
Open
janzizazizka wants to merge 1 commit intoboostorg:developfrom
Open
Conversation
Move the std::pair<A,B> partial specializations for the following traits from boost/container/detail/pair.hpp to the headers where the primary templates are defined: - is_trivially_destructible (type_traits.hpp) - is_trivially_copy_constructible (type_traits.hpp) - is_trivially_move_constructible (type_traits.hpp) - is_trivially_copy_assignable (type_traits.hpp) - is_trivially_move_assignable (type_traits.hpp) - has_trivial_destructor_after_move (traits.hpp) When the specializations live in pair.hpp (included late via flat_map.hpp), GCC diagnoses "partial specialization of '...' after instantiation of '...'" in unity/jumbo builds or any translation unit that implicitly instantiates a trait for std::pair before pair.hpp is included. This is a regression introduced in Boost 1.88/1.90 by commit 9552828 and is the same class of bug as Trac #12534. The new specializations implement direct member-wise checks (trait<A>::value && trait<B>::value) instead of inheriting from the dtl::pair specializations, so they are self-contained within Boost.Move. Fixes: boostorg/container#330 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Move the std::pair<A,B> partial specializations for the following traits from boost/container/detail/pair.hpp to the headers where the primary templates are defined:
When the specializations live in pair.hpp (included late via flat_map.hpp), GCC diagnoses "partial specialization of '...' after instantiation of '...'" in unity/jumbo builds or any translation unit that implicitly instantiates a trait for std::pair before pair.hpp is included. This is a regression introduced in Boost 1.88/1.90 by commit 9552828 and is the same class of bug as Trac #12534.
The new specializations implement direct member-wise checks (trait::value && trait::value) instead of inheriting from the dtl::pair specializations, so they are self-contained within Boost.Move.
Fixes: boostorg/container#330