Skip to content

Make various Legacy classes Nothrow_copyable #19102

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abarton5
Copy link

This Pull request:

Improves the type_trait deduction of various legacy classes. This provides performance benefits for composite objects in certain situations.

Add static_asserts for verification

No documentation changes should be necessary

Changes or fixes:

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

This PR fixes #
#9042

@@ -78,6 +78,9 @@ int TestVectors()
int TestVector3() {

// test constructors:
static_assert(std::is_nothrow_copy_constructible_v<TVector3>);
static_assert(std::is_nothrow_copy_constructible_v<TVector2>);
static_assert(std::is_nothrow_copy_constructible_v<TLorentzRotation>);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks!
Other potential checks you coud add:

static_assert(std::is_nothrow_move_constructible_v);
static_assert(std::is_trivially_move_constructible_v);
static_assert(std::is_nothrow_move_assignable_v);
static_assert(std::is_trivially_move_assignable_v);
static_assert(std::is_trivially_copyable_v);
static_assert(std::is_trivially_destructible_v);

Copy link
Author

Choose a reason for hiding this comment

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

These cannot be trivially anything because they depend on TObject.

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.

2 participants