Traits.h: Use std::is_trivially_relocatable if P1144 is available #2216
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.
Well, llvm/llvm-project#84621 isn't going anywhere in Clang, therefore #2159 will presumably never be mergeable (in the foreseeable future, anyway).
So here's an alternative approach, for your consideration: If P1144's feature-test macro is set, then use
std::is_trivially_relocatable<T>in place ofstd::is_trivially_copyable<T>.This will produce improved codegen for e.g.
fbvector<std::vector<int>>::erase, when compiled on a compiler supporting P1144 semantics. https://godbolt.org/z/s6sa313h3Compare https://github.com/charles-salvia/std_error/blob/3abc272/all_in_one.hpp#L180-L196