Created on 2022-08-23.00:00:00 last changed 12 months ago
Proposed resolution:
This wording is relative to n4917.
Change [expected.object.general] as indicated:
// 22.8.6.2, constructors constexpr expected(); constexpr expected(const expected&); constexpr expected(expected&&) noexcept(see below); template<class U, class G> constexpr explicit(see below) expected(const expected<U, G>&); template<class U, class G> constexpr explicit(see below) expected(expected<U, G>&&); template<class U = T> constexpr explicit(see below) expected(U&& v); template<class G> constexpr explicit(see below) expected(const unexpected<G>&); template<class G> constexpr explicit(see below) expected(unexpected<G>&&); template<class... Args> constexpr explicit expected(in_place_t, Args&&...);
Change [expected.void.general] as indicated:
// 22.8.7.2, constructors constexpr expected() noexcept; constexpr expected(const expected&); constexpr expected(expected&&) noexcept(see below); template<class U, class G> constexpr explicit(see below) expected(const expected<U, G>&&); template<class G> constexpr explicit(see below) expected(const unexpected<G>&); template<class G> constexpr explicit(see below) expected(unexpected<G>&&); constexpr explicit expected(in_place_t) noexcept;
[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP. ]
[ 2022-09-07; Moved to "Ready" at LWG telecon ]
[ 2022-09-05; Jonathan Wakely provides wording ]
In n4910 the expected synopses had explicit(see below) on the copy and move constructors. That was fixed editorially, but this other inconsistency was not noticed.
[expected.object.general] declares the following constructors:
template<class G> constexpr expected(const unexpected<G>&); template<class G> constexpr expected(unexpected<G>&&);
But in [expected.object.ctor], these constructors are declared as:
template<class G> constexpr explicit(!is_convertible_v<const G&, E>) expected(const unexpected<G>& e); template<class G> constexpr explicit(!is_convertible_v<G, E>) expected(unexpected<G>&& e);
Note that they have no explicit-specifiers in [expected.object.general], but are conditionally explicit in [expected.object.ctor].
I presume that [expected.object.general]
is missing a few explicit(see below)
.
The same inconsistency exists in [expected.void].
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-11-17 00:42:33 | admin | set | messages: + msg13063 |
2022-11-17 00:42:33 | admin | set | status: voting -> wp |
2022-11-08 03:46:49 | admin | set | status: ready -> voting |
2022-09-07 17:14:22 | admin | set | messages: + msg12747 |
2022-09-07 17:14:22 | admin | set | status: new -> ready |
2022-09-07 08:38:53 | admin | set | messages: + msg12746 |
2022-09-07 08:38:53 | admin | set | messages: + msg12745 |
2022-08-23 00:00:00 | admin | create |