cplusplus / nbballot

Handling of NB comments in response to ballots
14 stars 4 forks source link

US303 24.07.5.2 Constrain return type of transformation function for transform_view LWG 3325 #299

Closed wg21bot closed 4 years ago

wg21bot commented 4 years ago

The transform_view does not constrain the return type of the transformation function. It is invalid to pass a void-returning transformation function to the transform_view, which would cause its iterators’ operator* member to return void.

Proposed change: Change the constraints on transform_view to the following:

template<input_range V, copy_constructible F>
  requires view<V> && is_object_v<F> &&
    regular_invocable<F&, range_reference_t<V>> &&
    can-reference<:invoke_result_t<F&, range_reference_t<V>>>
class transform_view
jwakely commented 4 years ago

Reviewed by LWG small group on Monday morning.

Dani-Hub commented 4 years ago

The associated issue is LWG 3325

JeffGarland commented 4 years ago

LWG issue is Ready as of 2019-11-07