-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add swap method for array class #152
base: main
Are you sure you want to change the base?
Conversation
adayton1
commented
Jun 7, 2024
- Adds swap method for array class and external swap method for two arrays
- Adds test case for swap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks @adayton1!
CAMP_HOST_DEVICE constexpr | ||
typename std::enable_if<std::is_nothrow_move_constructible<T>::value && | ||
std::is_nothrow_move_assignable<T>::value>::type | ||
swap(array& a) noexcept(std::is_nothrow_swappable<T>::value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is_nothrow_swappable is C++17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right you are. Converting back to a draft until I have time to look at this again.