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

Type of parameter in constructor of class __transform_functor #2085

Closed
SergeyKopienko opened this issue Feb 27, 2025 · 1 comment
Closed
Assignees
Milestone

Comments

@SergeyKopienko
Copy link
Contributor

SergeyKopienko commented Feb 27, 2025

Not quite understood why the constructor class __transform_functor is implemented not for r-value type of parameter :

explicit __transform_functor(_Pred __pred) : _M_pred(::std::move(__pred)) {}

In all use cases we move parameter into it:
https://github.com/search?q=repo%3Auxlfoundation%2FoneDPL+%3A%3A__transform_functor&type=code

So I mean may be better to implement it like we did for __transform_if_unary_functor :

explicit __transform_if_unary_functor(_UnaryOper&& __op, _UnaryPred&& __pred)

Example - https://godbolt.org/z/aKG4qdhjr, case 4 and 8

UPD: last modification has been made in the PR #1233, but I think not till the end.

SergeyKopienko added a commit that referenced this issue Feb 27, 2025
@SergeyKopienko SergeyKopienko changed the title Type of parameter in constructor __transform_functor Type of parameter in constructor of __transform_functor Feb 27, 2025
@SergeyKopienko SergeyKopienko changed the title Type of parameter in constructor of __transform_functor Type of parameter in constructor of class __transform_functor Feb 27, 2025
SergeyKopienko added a commit that referenced this issue Feb 27, 2025
SergeyKopienko added a commit that referenced this issue Mar 3, 2025
@SergeyKopienko SergeyKopienko self-assigned this Mar 6, 2025
@SergeyKopienko SergeyKopienko added this to the 2022.9.0 milestone Mar 6, 2025
@SergeyKopienko
Copy link
Contributor Author

Fixed in the PR's #2091, #2098

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant