-
Notifications
You must be signed in to change notification settings - Fork 46
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
Use strongly typed configuration options instead of multiple bools #45
Comments
Yes, you are right about the Currently, the |
Sounds great.
Hmm. I'm not sure if I got you correctly. So my current understanding is that, if the underlying object's move constructor/assignment are not noexcept, and if HasStrongExceptGuarantee is set to be true, and if SBO is in action, then the move actually behaves as if it were copy. Is this correct? |
https://en.cppreference.com/w/cpp/language/exceptions
Currently point 2) is not supported by function2. The only thing that By marking the move constructor, move assignment operator, and destructor of the function2 type-erasure as I see that this case is misleading and it would be better if we rename |
Thanks for clarification. Looking forward to the next release! |
@Naios Here are some suggestions about
fu2::function_base
.In my opinion, better alternatives might be:
enum
types for each policy parameter, orThe second approach might require more template metaprogramming, but it's open-ended (users can add more options at their will) while the enum approach is closed-ended. This might be either pros or cons, though.
I recommend the enum approach, and I think there is virtually no downside of it compared to the boolean approach, except that the implementation might be a bit more verbose.
HasStrongExceptGuarantee
is meant to mean. I mean, I know what strong exception guarantee means in general, but I think it might be better to explicitly say (1) where are the placesfu2::function_base
is guarding against exceptions whenHasStrongExceptGuarantee
is set to betrue
, and (2) exactly what invariants are preserved. I assumed these are about copy assignment, is that correct?Thanks!
The text was updated successfully, but these errors were encountered: