vsg::Inherit::create doesn't use perfect forwarding #1098
AnyOldName3
started this conversation in
Ideas
Replies: 1 comment
-
An oversight, I assumed that it'd be passed on without changing type. Try changing it, if everything builds cleanly we can merge this improvements. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The methods of
vsg::Inherit
, such as its constructor andcreate
take forwarding references as variadic templated parameters, and then don't usestd::forward
to actually forward them to the other class. That means that the forwarding references decay to lvalue references, and any functions expecting forwarding/rvalue references won't get them. That in turn means that there'll be redundant copies that could have been cheaper moves instead.The simple fix would be to change
to
and do the same for similar methods.
Was this just an oversight, or was there some intentional reason to disable forwarding?
Beta Was this translation helpful? Give feedback.
All reactions