-
Notifications
You must be signed in to change notification settings - Fork 64
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 support for non trivial objects #23
Comments
Can you elaborate on this? Looking through the code it's not obvious what or where a failure would occur. |
Currently insert/removal uses copy constructors everywhere, (i.e. |
As I understand, this should work fine if the author of the class has properly implemented the copy assignment operator. For example, if |
ah, assignment, not constructor. It will still leak until given slot is reused for new data, not to mention that the buffer array is uninitialized. I'll add the assert until figuring out the std::move + rval refs and all of the related "what ifs". |
I think the slot would hold onto memory until reuse, but that’s much better than a leak because the buffer size is bounded. Anyway thanks for the library! |
The copy assignment Is my understand correct? |
Currently the buffer array is uninitialized, so that will be very undefined operation. This would also make the copy constructors unusable for it's intended purpose. |
I see. So, if the type can be default constructed, then it will be fine? |
As long as all members are also trivially (default) constructible. |
should use move mechanic or put another static assert
The text was updated successfully, but these errors were encountered: