[Bug c++/68784] deductible parameter type still requires explicit reference cast, e.g., std::thread
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Dec 8 10:24:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68784
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Your version of MSVC does not follow the standard. std::thread copies its
arguments and forwards them as rvalues, so an lvalue cannot bind to the
non-const reference parameter. That's why you need to use std::ref.
More information about the Gcc-bugs
mailing list