This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 7 Oct 2010 00:46:29 +0000
- Subject: [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs
- Auto-submitted: auto-generated
- References: <bug-45893-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45893
--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> 2010-10-07 00:46:26 UTC ---
The _Bind and _Bind_result ctors need to be made into templates so that they
can deduce the arguments as either lvalue or rvalue references, allowing
_Bound_args elements to be move-constructed if an rvalue is passed to
std::bind. Two template ctors are needed, for the case where the first
argument is an lvalue or an rvalue.
I added a copy ctor and move ctor, allowing _Bind and _Bind_result objects to
be moved
The new _Bind_helper and _Bindres_helper templates are simply to avoid
repeating typename _Maybe_wrap_member_pointer<typename
decay<_Functor>::type>::type in the return type and body of std::bind.
The call_once patch is for DR891, but is related to this PR because we use
std::bind to implement call_once.