Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wg21bot opened this issue Oct 25, 2019 · 3 comments · Fixed by cplusplus/draft#3748
Labels
accepted LWG Library ranges std::ranges
Milestone

Comments

@wg21bot
Copy link
Collaborator

wg21bot commented Oct 25, 2019

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
@wg21bot wg21bot added the LWG Library label Oct 25, 2019
@jensmaurer jensmaurer added the ranges std::ranges label Oct 25, 2019
@jwakely
Copy link
Member

jwakely commented Nov 4, 2019

Reviewed by LWG small group on Monday morning.

@Dani-Hub
Copy link
Member

Dani-Hub commented Nov 6, 2019

The associated issue is LWG 3325

@JeffGarland
Copy link
Member

LWG issue is Ready as of 2019-11-07

@jensmaurer jensmaurer changed the title US303 24.07.5.2 Constrain return type of transformation function for transform_view US303 24.07.5.2 Constrain return type of transformation function for transform_view LWG 3325 Nov 7, 2019
@mclow mclow added the accepted label Jan 31, 2020
@jensmaurer jensmaurer added this to the CD C++20 milestone Sep 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted LWG Library ranges std::ranges
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants