-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Trivial types #263
Comments
How would that possible? |
Not sure about trivially constructible, but they could easily be trivially copyable (if they aren't already). Then you'd be able to use memcpy and memmove on them. |
I suppose it would be unreasonable to make them trivially constructible. But I propose trivially copyable as an enhancement. |
I think you had std::is_trivially_copy_assignable and std::is_trivially_copyable in mind. With a short experiment I should make vec4 being trivially copyable. I am not familiar with this, what's the value of doing it? |
Erm safe copy with memcpy... I never ever seen any issue with it before... |
GCC doesn't have those functions yet, but they should be equal. |
@Groovounet Having them be trivially copyable would mean that users of the library could, with appropriate padding, use memcpy directly to load an array of structs containing vectors/matrices into a buffer for GL following the std140 or std430 format. Otherwise you'd be invoking undefined behavior. |
…dualquat trivially constructible #263
Correct me if I am wrong but it seems to me that all GLM types can be is trivially copyable which they all are now so i am closing the bug. Don't hesitate to open another bug or reopen the bug if you see additional opportunities. Thanks for reporting, |
Is it possible to make the vec types trivially constructable? (std::is_trivial)
If so; are there any plans for this?
The text was updated successfully, but these errors were encountered: