Created on 2017-06-27.00:00:00 last changed 1 month ago
Proposed resolution:
This wording is relative to N4659.
Edit [variant.variant], class template variant synopsis, as indicated:
template <class... Types> class variant { public: // 23.7.3.1, constructors constexpr variant() noexcept(see below); variant(const variant&) noexcept(see below); variant(variant&&) noexcept(see below); […] };
Edit [variant.ctor] as indicated:
variant(const variant& w) noexcept(see below);[…]
-8- Remarks: This function shall not participate in overload resolution unless is_copy_constructible_v<Ti> is true for all i. The expression inside noexcept is equivalent to the logical AND of is_nothrow_copy_constructible_v<Ti> for all i.
[ 2017-07 Toronto Tuesday PM issue prioritization ]
Status to LEWG
The copy constructor of std::variant is not conditionally noexcept (I think it was in the original proposal.)
It should be, for two reasons: first, this would be consistent with the other three constructorsconstexpr variant() noexcept(see below); variant(variant&&) noexcept(see below); template <class T> constexpr variant(T&&) noexcept(see below);
and second, variant itself makes use of is_nothrow_copy_constructible, so it's inconsistent for it to take a stance against it.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-11-19 16:09:33 | admin | set | messages: + msg14459 |
2024-11-19 16:09:33 | admin | set | status: lewg -> open |
2017-07-12 01:58:24 | admin | set | messages: + msg9354 |
2017-07-12 01:58:24 | admin | set | status: new -> lewg |
2017-06-27 20:14:55 | admin | set | messages: + msg9301 |
2017-06-27 00:00:00 | admin | create |