You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any benefit to the defaulted constructor? Why define it twice? The default member-initializers mean it's never trivial, even if defined as defaulted.
Unless I'm missing something, it looks like this could be simply:
constexpr optional() noexcept {}
The text was updated successfully, but these errors were encountered:
I don't think there's a requirement for optional to be trivial, so I don't think that's it. It may have been an older compiler being unhappy. Will change and confirm in tests.
https://github.com/beman-project/Optional26/blob/bfeb9080c0d9c501965ae857a1decf7ed74686f5/include/Beman/Optional26/optional.hpp#L325-L331
Is there any benefit to the defaulted constructor? Why define it twice? The default member-initializers mean it's never trivial, even if defined as defaulted.
Unless I'm missing something, it looks like this could be simply:
constexpr optional() noexcept {}
The text was updated successfully, but these errors were encountered: