Skip to content

<optional>: Mystery LWG issue citations #1770

@StephanTLavavej

Description

@StephanTLavavej

STL/stl/inc/optional

Lines 417 to 421 in dcba13b

template <class _Ty2>
_NODISCARD constexpr remove_cv_t<_Ty> value_or(_Ty2&& _Right) const& {
static_assert(is_convertible_v<const _Ty&, remove_cv_t<_Ty>>,
"The const overload of optional<T>::value_or requires const T& to be convertible to remove_cv_t<T> "
"([optional.observe]/18 as modified by LWG-XXXX).");

STL/stl/inc/optional

Lines 431 to 435 in dcba13b

template <class _Ty2>
_NODISCARD constexpr remove_cv_t<_Ty> value_or(_Ty2&& _Right) && {
static_assert(is_convertible_v<_Ty, remove_cv_t<_Ty>>,
"The rvalue overload of optional<T>::value_or requires T to be convertible to remove_cv_t<T> "
"([optional.observe]/20 as modified by LWG-XXXX).");

  • Was an LWG issue filed for this?
    • If not, we should file it.
    • If so, we should cite the number.
    • If it's already been voted into the WP, we should drop "as modified by" entirely.
  • We should cite a WP for [optional.observe]. (Paragraphs can be renumbered over time.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationRelated to documentation or commentsfixedSomething works now, yay!good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions