https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96036

            Bug ID: 96036
           Summary: Please make std::optinal noexcept constructible when
                    possible
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rafael at espindo dot la
  Target Milestone: ---

Only the move constructor of std::optional is conditionally noexcept.

The standard in res.on.exception.handling says:

An implementation may strengthen the exception specification for a non-virtual
function by adding a non-throwing exception specification.

So it should be possible to also make

template < class U = value_type >
constexpr optional( U&& value );

conditionally noexcept.

libstdc++ already does that for std::tuple.

Reply via email to