di icon indicating copy to clipboard operation
di copied to clipboard

BUG: Misuse of std::forward

Open Phygon opened this issue 6 years ago • 0 comments

https://github.com/boost-experimental/di/blob/19c30d5f5bc9946d7684457772fc3aa8b3bd43ef/extension/include/boost/di/extension/injections/factory.hpp#L35

std::forward is misused here, because TArgs&& is not a template argument of the create() function. That means, TArgs&& (all arguments in the parameter pack) are rvalue references, and reference collapsing cannot occur as intended.

Phygon avatar Apr 08 '19 11:04 Phygon