Fixed VS2022 17.8.0 and clang compilation of the SceneAPI PairIterato… #17008
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.
Fix VS2022 compile via cherry pick of:
dee68ec
original commit message:
The call to
AZStd::reverse
failed to the pair swap only supporting non-const pairs.In this particular case a const pair of int&
const pair<int&, int&>
were attempted to be swapped which did not compile.Een though the pair itself is const, the elements in it are refrences to non-const types and there they are still swappable.
Moved the pair class implementation from the utils.h header into it's own
pair.h/pair.inl
Added forwarding headers for pair, tuple and subrange that allows them to be referenced without needing a complete defintion. This allows circular includes to be avoided between the tuple.h, pair.h and subrange.h header as they all need to know about the other types for their constructors.
Add an implementation of the C++20
std::ranges::reverse
which can reverse a range container in place.The
common_type
specializations of AZStd::pair and std::tuple needs to occur in the std:: namespace, as that is where the `common_type structure is originally defined.The AZStd::pair class needs
std::tuple_element
to be specialized before the declaration of theAZStd::get
overloads for the AZStd::pair class in order to compile using clang/gcc.Fix iterator swap for SceneAPI PairIterator to move the values into a temporary.
Clang tuple_element fixes.
Clang build fixes for AZStd::pair changes
Updated the
AZStd::pair
pair-like constructor/assignment operatorsThe pair-like functions are used to construct an AZStd::pair from a tuple, subrange or array of size 2.
The constraint checking on the functions causing an instantiation of the supplied pair-like template argument, therefore causing the
AZStd::pair
class to require a complete type.That was cause of compilation issues when using clang.
Tested Locally in Editor