Skip to content

<type_traits>: std::byte is _Is_trivially_swappable_v#2044

Merged
StephanTLavavej merged 7 commits intomicrosoft:mainfrom
fsb4000:fix2039
Jul 30, 2021
Merged

<type_traits>: std::byte is _Is_trivially_swappable_v#2044
StephanTLavavej merged 7 commits intomicrosoft:mainfrom
fsb4000:fix2039

Conversation

@fsb4000
Copy link
Contributor

@fsb4000 fsb4000 commented Jul 7, 2021

Fixes #2039

@fsb4000 fsb4000 requested a review from a team as a code owner July 7, 2021 08:20
Copy link
Contributor

@AdamBucior AdamBucior left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also add the specializations for types like duration and time_point (if their underlying type is trivially swappable)

@fsb4000
Copy link
Contributor Author

fsb4000 commented Jul 12, 2021

@AdamBucior

I think we should also add the specializations for types like duration and time_point

How does such specialization look like? I'm sorry I do not understand.

@AdamBucior
Copy link
Contributor

How does such specialization look like? I'm sorry I do not understand.

template <class _Rep, class _Period>
inline constexpr bool _Is_trivially_swappable_v<duration<_Rep, _Period>> = _Is_trivially_swappable_v<_Rep>;

@StephanTLavavej StephanTLavavej merged commit 089a0da into microsoft:main Jul 30, 2021
@StephanTLavavej
Copy link
Member

Thanks for extending this optimization! 🚀 🚀 🐈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<type_traits>: std::byte is not _Is_trivially_swappable

5 participants