Skip to content

Move from rvalue range adaptor closures - #1410

Merged
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:masterfrom
CaseyCarter:closure-fix
Nov 7, 2020
Merged

Move from rvalue range adaptor closures#1410
Stephan T. Lavavej (StephanTLavavej) merged 2 commits into
microsoft:masterfrom
CaseyCarter:closure-fix

Conversation

@CaseyCarter

@CaseyCarter Casey Carter (CaseyCarter) commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

We currently have const-qualified member functions that attempt to move from member variables, which is at the very least confusing. This change splits the operator() const of views::filter and views::transform's corresponding range adaptor closure objects into const&-qualified and &&-qualified overloads that copy and move from, respectively, the stashed function object.

We currently have `const`-qualified member functions that attempt to move from member variables, which is at the very least confusing. This change splits the `operator() const` of `views::filter` and `views::transform`'s correspondng range adaptor closure objects into `const&`-qualified and `&&`-qualified overloads that copy and move from, respectively, the stashed function object.
@CaseyCarter Casey Carter (CaseyCarter) added performance Must go faster ranges C++20/23 ranges labels Oct 29, 2020
@CaseyCarter
Casey Carter (CaseyCarter) requested a review from a team as a code owner October 29, 2020 01:06
Comment thread stl/inc/ranges
Comment thread tests/std/tests/P0896R4_views_filter/test.cpp Outdated
Comment thread tests/std/tests/P0896R4_views_transform/test.cpp Outdated
@StephanTLavavej

Copy link
Copy Markdown
Member

Thanks for this cleanup and/or potential performance improvement! 🧹 🚀

@CaseyCarter
Casey Carter (CaseyCarter) deleted the closure-fix branch November 9, 2020 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Must go faster ranges C++20/23 ranges

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants