[Bug c++/50929] [C++0x] Wrong function selected for overload with template and rvalue reference
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Mon Oct 31 08:25:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50929
--- Comment #3 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-10-31 08:24:58 UTC ---
(In reply to comment #2)
> That's a shame, and rather annoying. I read pages and pages of the standard to
> try to understand this one. Do you know where this is explained?
Actually this is already required in C++03 (modulo perfect forwarding), see
[class.copy], footnote 106:
"Because a template constructor is never a copy constructor, the presence of
such a template does not suppress the implicit declaration of a copy
constructor. Template constructors participate in overload resolution with
other constructors, including copy constructors, and a template constructor may
be used to copy an object if it provides a better match than other
constructors."
In C++11 this is just part of the general description of initialization
semantics in N3290, [dcl.init] p16.
More information about the Gcc-bugs
mailing list