From patchwork Fri Dec 5 10:37:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 418063 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 3EF2A140100 for ; Fri, 5 Dec 2014 21:37:17 +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:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=uIsApaD+EmVADgWO5NleKMYY/J0S/E cMa+QgCPXvtucR4v1qO1EpVpyaULMYVnop6qhi4G1rkWn2gTcQ8qWuFCYSQ6P8xH HKtwFHKLDspQa8tF4ZQmhHINyiJhxd/q3qHTqDm3GfDiWvukqHdLQ1/DiicW7vPl p6gPeYtekM218= 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:references:mime-version:content-type :in-reply-to; s=default; bh=a7lkzTaldn5VUK/gNCsgx/KLwbc=; b=jTc/ LCozZPh1qpTf4hu7PytDJRsoh6LsCQZBPAyqBDs6LhtyQKVVYS/04136pOVTPK6l dV+z9bZykS+TJPuxlax+E2rA9Bbc7ljvuaYMArvrrlOWQ2xlOPL/4U3TylO1Uo8L DTlUvQ9bmkpJgQ3lXAZsKCVb1aDVp9G2GzRkqMA= Received: (qmail 13080 invoked by alias); 5 Dec 2014 10:37:10 -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 13057 invoked by uid 89); 5 Dec 2014 10:37:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, T_RP_MATCHES_RCVD 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; Fri, 05 Dec 2014 10:37:07 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB5Ab6KA010885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 5 Dec 2014 05:37:06 -0500 Received: from localhost (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB5Ab5Af032298; Fri, 5 Dec 2014 05:37:06 -0500 Date: Fri, 5 Dec 2014 10:37:05 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [patch] Simplify non-inline function definitions for std::unordered_xxx containers Message-ID: <20141205103705.GX3134@redhat.com> References: <20141203120018.GL3134@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20141203120018.GL3134@redhat.com> User-Agent: Mutt/1.5.23 (2014-03-12) On 03/12/14 12:00 +0000, Jonathan Wakely wrote: >While working on PR57272 for unordered containers I was getting a >headache reading all the return types with nested-name-qualifiers >split over three or four lines. More of the same. Tested powerpc64-linux, committed to trunk. commit f99108f25854efc6858f465361be57816bdd1ebc Author: Jonathan Wakely Date: Fri Dec 5 10:20:15 2014 +0000 * include/bits/hashtable_policy.h (_Map_base::operator[], _Map_base::at): Simplify definitions with trailing return types. diff --git a/libstdc++-v3/include/bits/hashtable_policy.h b/libstdc++-v3/include/bits/hashtable_policy.h index 74d1bd0..cab25ef 100644 --- a/libstdc++-v3/include/bits/hashtable_policy.h +++ b/libstdc++-v3/include/bits/hashtable_policy.h @@ -584,12 +584,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template - typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, - _H1, _H2, _Hash, _RehashPolicy, _Traits, true> - ::mapped_type& + auto _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>:: operator[](const key_type& __k) + -> mapped_type& { __hashtable* __h = static_cast<__hashtable*>(this); __hash_code __code = __h->_M_hash_code(__k); @@ -610,12 +609,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template - typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, - _H1, _H2, _Hash, _RehashPolicy, _Traits, true> - ::mapped_type& + auto _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>:: operator[](key_type&& __k) + -> mapped_type& { __hashtable* __h = static_cast<__hashtable*>(this); __hash_code __code = __h->_M_hash_code(__k); @@ -636,12 +634,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template - typename _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, - _H1, _H2, _Hash, _RehashPolicy, _Traits, true> - ::mapped_type& + auto _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>:: at(const key_type& __k) + -> mapped_type& { __hashtable* __h = static_cast<__hashtable*>(this); __hash_code __code = __h->_M_hash_code(__k); @@ -656,12 +653,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template - const typename _Map_base<_Key, _Pair, _Alloc, _Select1st, - _Equal, _H1, _H2, _Hash, _RehashPolicy, - _Traits, true>::mapped_type& + auto _Map_base<_Key, _Pair, _Alloc, _Select1st, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits, true>:: at(const key_type& __k) const + -> const mapped_type& { const __hashtable* __h = static_cast(this); __hash_code __code = __h->_M_hash_code(__k);