From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20338 invoked by alias); 7 Oct 2010 00:46:35 -0000 Received: (qmail 20329 invoked by uid 22791); 7 Oct 2010 00:46:34 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Oct 2010 00:46:30 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/45893] [C++0x] [DR 817] Finish updating std::bind to rvalue refs X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.0 X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 07 Oct 2010 00:46:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg00599.txt.bz2 Message-ID: <20101007004600.FD-Y25ysLApKtMgy-xI7ek5WvVkbdhDpOdsPaM6ert8@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45893 --- Comment #8 from Jonathan Wakely 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::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.