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

Add swap method for array class #152

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

adayton1
Copy link
Member

@adayton1 adayton1 commented Jun 7, 2024

  • Adds swap method for array class and external swap method for two arrays
  • Adds test case for swap

MrBurmark
MrBurmark previously approved these changes Jun 7, 2024
@adayton1 adayton1 marked this pull request as draft June 7, 2024 18:31
@adayton1 adayton1 marked this pull request as ready for review June 7, 2024 18:38
@adayton1 adayton1 requested review from trws and MrBurmark June 10, 2024 22:55
Copy link
Member

@trws trws left a 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) {
Copy link
Member

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

Copy link
Member Author

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.

@adayton1 adayton1 marked this pull request as draft June 27, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants