Skip to content

Conversation

@HIROSN
Copy link
Contributor

@HIROSN HIROSN commented Aug 22, 2024

In RouteSource::operator(), r-value's in 'args' are used in a later loop iteration after they were forwarded/moved to a target in the first loop iteration. Proposed fix is to remove usage of std::forward and pass 'args' only as l-value's to targets.

@HIROSN HIROSN requested a review from a team as a code owner August 22, 2024 03:47
@HIROSN HIROSN force-pushed the user/hirosn/clangtidyissue branch 2 times, most recently from 001f441 to 7ff3234 Compare August 22, 2024 06:04
@HIROSN HIROSN force-pushed the user/hirosn/clangtidyissue branch from 8b0db87 to 2599dc7 Compare August 22, 2024 06:30
@HIROSN HIROSN changed the title ClangTidy issue in lib/system/Route.hpp #1296 ClangTidy issue in lib/system/Route.hpp Aug 22, 2024
@HIROSN HIROSN requested review from ThomsonTan and lalitb August 22, 2024 15:08
{
for (IRoutePassThrough<TArgs...>* target : m_passthroughs) {
if (!(*target)(std::forward<TRealArgs>(args) ...)) {
if (!(*target)(args ...)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will args be coped for each call?

RouteSink<RouteTests, int> sink1{this, &RouteTests::handleSink1};
RoutePassThrough<RouteTests, int> passThrough1a{this, &RouteTests::handlePassThrough1a};
RoutePassThrough<RouteTests, int> passThrough1b{this, &RouteTests::handlePassThrough1b};
RouteSink<RouteTests, int, bool&, NonCopyableThing const&, Canary> sink4{this, &RouteTests::handleSink4};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sink4

Is this change relating to the change in RouteSource::operator()?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants