From patchwork Tue Nov 4 02:51:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 406421 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C944414003E for ; Tue, 4 Nov 2014 15:41:27 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=vKU12ct1iF3LFQ9yxIov9XidnRTd2VGGFoo1to2rDNZR51DtaGYIV 5jzkI270s8lRvh+Agwh4pEp0H6079lFsI89yik7lHDUdxakqhLlOSAdeWfEkFNbx WOg89eCKEMD2R5b3NovcCtSe5tufl85fEe9fZsJfzpudzAuRYlHcxI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=FPVrSTDnlH4PQt3KwokUVLtH/eY=; b=aUqBxr05ucawXvOLjTtv RnYZHIgxOdVThidrcDXUUzCGyFMK9Uc/5sjf1j2TfOnDAOge8QwKzrPmYAqCGdNX DwF5h5qmyCq/3iDJStmu8GKrhrX1gHui9m5KFBCjN/VevbhXYm9djz54LLfnZIxr qEqkY6v5eWkR7U6SKE55Izo= Received: (qmail 23390 invoked by alias); 4 Nov 2014 02:52:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23371 invoked by uid 89); 4 Nov 2014 02:52:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 04 Nov 2014 02:52:02 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA42q01V000639 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Nov 2014 21:52:00 -0500 Received: from localhost (ovpn-116-19.ams2.redhat.com [10.36.116.19]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA42px0i020184; Mon, 3 Nov 2014 21:52:00 -0500 Date: Tue, 4 Nov 2014 02:51:58 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Simplify construction of _Bind_simple in Message-ID: <20141104025158.GC3961@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) With the arity-checking I added recently we don't need the SFINAE constraints on the number of arguments to _Bind_simple's constructors. Tested x86_64-linux, committed to trunk. commit d78bba658af1677b873d391649ee237150b3c916 Author: Jonathan Wakely Date: Mon Nov 3 14:52:15 2014 +0000 * include/std/functional (_Bind_simple): Simplify construction. diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index f615ae4..f8e9b54 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -1582,18 +1582,10 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) { typedef typename result_of<_Callable(_Args...)>::type result_type; - template::type> + template explicit - _Bind_simple(const _Callable& __callable, _Args2&&... __args) - : _M_bound(__callable, std::forward<_Args2>(__args)...) - { } - - template::type> - explicit - _Bind_simple(_Callable&& __callable, _Args2&&... __args) - : _M_bound(std::move(__callable), std::forward<_Args2>(__args)...) + _Bind_simple(_Tp&& __f, _Up&&... __args) + : _M_bound(std::forward<_Tp>(__f), std::forward<_Up>(__args)...) { } _Bind_simple(const _Bind_simple&) = default; @@ -1607,7 +1599,6 @@ _GLIBCXX_HAS_NESTED_TYPE(result_type) } private: - template typename result_of<_Callable(_Args...)>::type _M_invoke(_Index_tuple<_Indices...>)