Skip to content

ExternType fails static assert because the C++ type has a copy constructor #365

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

Closed
scott-wilson opened this issue Oct 18, 2020 · 2 comments
Labels

Comments

@scott-wilson
Copy link

Hello!

I'm creating a wrapper for OpenImageIO, and I'm running into an issue where I can't pass the static check

" ::std::is_trivially_move_constructible<{}>::value,",
because of this copy constructor https://github.com/OpenImageIO/oiio/blob/665c634b12ea8bc206e7a5dd9475cffa974e8522/src/include/OpenImageIO/typedesc.h#L165.

I could be wrong, but it it looks like this should pass, so this may be a case where removing the static check may be okay, however, having this in the first place did stop me to make sure I wasn't being a complete idiot and brought me to where we are now.

So, I have two main questions:

  1. Is this static assert correct, and I have to wrap this in a unique pointer (or some option C)?
  2. If this static assert can go away, then are we able to do this in a way where we can say "I'm absolutely sure that this type is okay to use" and still keep the static checks in place? Or, would it be on me in my c++ wrapper side to make sure the static asserts are in place?
@adetaylor
Copy link
Collaborator

I think #359 is the proposal to provide just the sort of override you need.

@scott-wilson
Copy link
Author

Ack. That's what happens when you post before really looking at the issues. I'll close this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants