Date
2021-10-14.09:56:08
Message id
12134

Content

Proposed resolution:

This wording is relative to N4892.

  1. Modify [range.copy.wrap] as indicated:

    -1- Many types in this subclause are specified in terms of an exposition-only class template copyable-box. copyable-box<T> behaves exactly like optional<T> with the following differences:

    1. (1.1) — […]

    2. (1.2) — […]

    3. (1.3) — If copyable<T> is not modeled, the copy assignment operator is equivalent to:

      constexpr copyable-box& operator=(const copyable-box& that)
        noexcept(is_nothrow_copy_constructible_v<T>) {
        if (this != addressof(that)) {
          if (that) emplace(*that);
          else reset();
        }
        return *this;
      }
      
    4. (1.4) — If movable<T> is not modeled, the move assignment operator is equivalent to:

      constexpr copyable-box& operator=(copyable-box&& that)
        noexcept(is_nothrow_move_constructible_v<T>) {
        if (this != addressof(that)) {
          if (that) emplace(std::move(*that));
          else reset();
        }
        return *this;
      }