This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Tentatively Ready status.
std::make_optional
overloadsSection: 22.5.10 [optional.specalg] Status: Tentatively Ready Submitter: Jiang An Opened: 2021-10-23 Last modified: 2025-10-16
Priority: 3
View all issues with Tentatively Ready status.
Discussion:
Three std::make_optional
overloads are specified in 22.5.10 [optional.specalg].
The first one is specified by "Returns:" and the other two are specified by "Effects: Equivalent to:".
According to 16.3.2.4 [structure.specifications]/4, such uses of "Effects: Equivalent to:"
propagate the Constraints specified for constructors. As the selected constructor for the first
overload has "Constraints:" (22.5.3.2 [optional.ctor]/22), it seems that inconsistency is introduced here.
[2022-01-29; Reflector poll]
Set priority to 3 after reflector poll.
[2025-10-16; Status changed: New → Tentatively Ready.]
Reflector poll in 2024-07 with eight supporting votes.
Proposed resolution:
This wording is relative to N4901.
Modify 22.5.10 [optional.specalg] as indicated:
template<class T> constexpr optional<decay_t<T>> make_optional(T&& v);-3-
ReturnsEffects: Equivalent to:return optional<decay_t<T>>(std::forward<T>(v));
.