-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Make ETL_TYPEDEF Trivially Copyable #1000
Comments
I see BOOST's strong typedefs are very similar and also not trivially copyable. Is there a reason why? With the way it's implemented I'm not sure why it would need to be defined? Would it be for if the underlying type wasn't trivially copyable? |
I've tried a few experiments, with both trivially and non-trivially copyable types, with the default constructor, copy constructor, and assignment operator removed or defaulted, and everything appears to work as expected. ETL_TYPEDEF(uint32_t, type1_t); bool b1 = std::is_trivially_copyable_v<type1_t>; // true |
That is awesome news! I'm hoping to have something in within a couple days if you don't beat me to it :) I'd also aim for the move ctor and assignment to be defaulted as well. |
I'm getting a clang-tidy warning when passing around an ETL_TYPEDEF(degrees, float) by copy to pass it as const reference. Doing some research, clang-tidy weighs the check with whether the type is trivially copyable. I think the way the strong types are generated, there is no need to define the copy ctor or assignment operator.
The text was updated successfully, but these errors were encountered: