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.
Since
std::is_trivial
is deprecated in C++ 26, it makes sense to get rid of it in our code in advance. This is requested in the issue #1961.In
type_traits
, we simply inject names into the oneDPL namespace, so the only change there so far is to add a comment.In
glue_memory_impl,h
,is_trivial
is checked to "optimize" the implementation for trivial types (it is worth checking if that really brings any performance improvement, but let's keep that for later). There we have a few cases:uninitialized_copy/move
, the in-place construction is changed to the "copy" brick, which essentially does an assignment like*result = *input
. Therefore, here the check is for the result value type to be trivially default-constructible and trivially assignable from the input reference type.uninitialized_value_construct
, the "optimization" uses the "fill" brick which assigns a given value of the output value type. Therefore the new check is for trivially default-constructible and trivially copyable. The same logic applies touninitialized_fill
, which currently (before the patch) checks forstd::is_arithmetic
:)uninitialized_default_construct
, construction is fully skipped - so the check should be for trivially default-constructible only.Each of the described cases is fixed (and can be reviewed) in a separate commit.