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

ClangTidy issue in lib/system/Route.hpp #1297

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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 changed the title ClangTidy issue in lib/system/Route.hpp #1296 ClangTidy issue in lib/system/Route.hpp Aug 22, 2024
@@ -102,12 +102,12 @@ namespace MAT_NS_BEGIN {
void operator()(TRealArgs&& ... args) const
{
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