-
Notifications
You must be signed in to change notification settings - Fork 100
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
Noexcept on constructor #61
Comments
edit 2: amended for forwarding, is it correct now? If noexcept(std::is_nothrow_constructible<
typename std::remove_reference<T>::type,
T&&
>::value) If it needs conversion, then perhaps be something like: noexcept(std::is_nothrow_constructible<
typename detail::convertible_type_noref<T>::type,
T&&
>::value) To reduce clutter I just made up template <typename T>
using convertible_type_noref<T> = convertible_type<typename std::remove_reference<T>::type>; and added member |
What gets constructed is the |
That's what I said, if |
@lightmare not sure I understand what you mean here. Maybe you can create a real pull request so we can better see what you mean. |
Ok, but I'll probably need some help understanding where http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0086r0.pdf
In anthonyw and tomilov implementations, which use an actual |
@lightmare: We very likely will not support references at all. They have not worked in the past and it is unclear to me, why there are a few places in the code using Looking further, I do think we want proper I think the way forward is to first remove |
I'll add notes to specific lines in my previous pull req. indicating which are a), b) or neither. |
Notes added to lightmare@244c3b7 |
The constructor for
variant
is declarednoexcept
which is only true if the constructor for the underlying type is noexcept. Because we don't know which type that will be we can only mark the constructor noexcept if all underlying types have a noexcept constructor.variant/variant.hpp
Lines 584 to 590 in 861faa8
There is a comment
// nothrow
in there. It is unclear what it means. Maybe it was meant to say that we expect the constructor to be "nothrow", but that really must be encoded in code.The text was updated successfully, but these errors were encountered: