Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 7 commits into from
Jul 30, 2021

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)

tests/std/tests/VSO_0180469_ptr_cat/test.compile.pass.cpp Outdated Show resolved Hide resolved
@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 removed their assignment Jul 27, 2021
@StephanTLavavej StephanTLavavej self-assigned this Jul 29, 2021
@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
  翻译: