Created on 2022-09-12.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4917.
Modify [range.repeat.view] as shown:
template<class... TArgs, class... BoundArgs> requires constructible_from<T, TArgs...> && constructible_from<Bound, BoundArgs...> constexpr explicit repeat_view(piecewise_construct_t, tuple<Targs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{});-5- Effects: Initializes value_ with
arguments of types TArgs... obtained by forwarding the elements of value_argsmake_from_tuple<T>(std::move(value_args)) and initializes bound_ witharguments of types BoundArgs... obtained by forwarding the elements of bound_args. (Here, forwarding an element x of type U within a tuple object means calling std::forward<U>(x).)make_from_tuple<Bound>(std::move(bound_args)). The behavior is undefined if Bound is not unreachable_sentinel_t and bound_ is negative.
[ 2023-02-13 Approved at February 2023 meeting in Issaquah. Status changed: Immediate → WP. ]
[ Issaquah 2023-02-07; LWG ]
Move to Immediate for C++23
[ 2023-01-11; Jonathan provides new wording requested by LWG ]
[ 2022-09-23; Jonathan provides improved wording ]
Previous resolution [SUPERSEDED]:
This wording is relative to N4917.
Modify [range.repeat.view] as shown:
template<class... WArgs, class... BoundArgs> requires constructible_from<W, WArgs...> && constructible_from<Bound, BoundArgs...> constexpr explicit repeat_view(piecewise_construct_t, tuple<Wargs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{});-?- Preconditions: Bound is unreachable_sentinel_t, or the initialization of bound_ yields a non-negative value.
-5- Effects: Initializes value_ with arguments of types WArgs... obtained by forwarding the elements of value_args and initializes bound_ with arguments of types BoundArgs... obtained by forwarding the elements of bound_args. (Here, forwarding an element x of type U within a tuple object means calling std::forward<U>(x).)
[ 2022-09-23; Reflector poll ]
Set priority to 2 after reflector poll.
This is trying to state a requirement on users, but that's not what
Postconditions: means. Should be something more like:
Precondition: If Bound is not unreachable_sentinel_t,
the bound_ ≥ 0 after its initialization from bound_args.
Previous resolution [SUPERSEDED]:
This wording is relative to n4917.
Modify [range.repeat.view] as shown:
template<class... WArgs, class... BoundArgs> requires constructible_from<W, WArgs...> && constructible_from<Bound, BoundArgs...> constexpr explicit repeat_view(piecewise_construct_t, tuple<Wargs...> value_args, tuple<BoundArgs...> bound_args = tuple<>{});-5- Effects: Initializes value_ with arguments of types WArgs... obtained by forwarding the elements of value_args and initializes bound_ with arguments of types BoundArgs... obtained by forwarding the elements of bound_args. (Here, forwarding an element x of type U within a tuple object means calling std::forward<U>(x).)
-?- Postconditions: If Bound is not unreachable_sentinel_t, bound_ ≥ 0.
The first two value-bound pair constructors of repeat_view have the Preconditions that the integer-like object bound must be non-negative. However, the piecewise constructor does not mention the valid values for bound_args. It would be nice to add a Postconditions that the initialized bound_ must be greater than or equal to 0 here.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2023-02-13 11:31:32 | admin | set | messages: + msg13384 |
2023-02-13 11:31:32 | admin | set | status: immediate -> wp |
2023-02-09 02:35:59 | admin | set | messages: + msg13304 |
2023-02-09 02:35:59 | admin | set | status: new -> immediate |
2023-01-11 18:22:42 | admin | set | messages: + msg13203 |
2022-09-23 22:31:18 | admin | set | messages: + msg12805 |
2022-09-23 15:44:07 | admin | set | messages: + msg12804 |
2022-09-12 10:20:23 | admin | set | messages: + msg12759 |
2022-09-12 00:00:00 | admin | create |