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

NonCopyable is missing move operations #1144

Closed
Evangel63 opened this issue Jun 22, 2024 · 3 comments
Closed

NonCopyable is missing move operations #1144

Evangel63 opened this issue Jun 22, 2024 · 3 comments

Comments

@Evangel63
Copy link
Contributor

JPH::NonCopyable (and derived classes) are missing the move operations (move construction/assignment). Is there any reason for them to be non-moveable?

@jrouwe
Copy link
Owner

jrouwe commented Jun 22, 2024

I only marked classes NonCopyable where I thought it would not make sense to copy/move them or where it is even dangerous to do so (e.g. because of internal pointers). Which class would you like to move?

@Evangel63
Copy link
Contributor Author

JPH::DebugRenderer, it's only got JPH::Ref and UnorderedMap members, but the documentation for NonCopyable didn't say anything about moving, so I thought it was a mistake.

@jrouwe
Copy link
Owner

jrouwe commented Jun 23, 2024

JPH::DebugRenderer is a singleton that you allocate once and then keep until you're done simulating. In its constructor it sets the DebugRenderer::sInstance member (= pointer to the instance). I don't really see a reason for ever wanting to move this class to a new location, so I marked it as NonCopyable.

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

No branches or pull requests

2 participants