From patchwork Sat Nov 12 03:23:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 694007 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 3tG2Fn0M5pz9t0J for ; Sat, 12 Nov 2016 14:24:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="VXi6q7PR"; dkim-atps=neutral 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=h3r8YEkth1oeNq+S3oqVxxX04b2IxQpinpujWIyNWMSzz+lLJDU/d BF5k1VN0dh0SvAW+/0Dk4heahiha5D+kGxRJbK8oBHlrx+5PjLCy2t6La1ExKZxW qVmfD9le+iEIOC71KdA7Ar4Zq/aRZbIyB4g5dn3yNB6jv4PvY9N568= 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=saFhn5MLkxUdDv63Owa4zRI0BAk=; b=VXi6q7PRwzPohYY8Erj5 kFb+tri80SGh8JSF1K7+B/w+MdmhTGDrRGFXqHvn6pSx1hycG7FPZhBW85jI7hhW JsmjbBJD1xruE9L7DfzTI4lKryyn5hSxXxEeDUNfrqX06YAxMLMrEbc9y7c2HNUW zG37hgfHWfWVSYkdx87pk4g= Received: (qmail 24376 invoked by alias); 12 Nov 2016 03:24: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 24303 invoked by uid 89); 12 Nov 2016 03:24:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=HTo:U*libstdc 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 ESMTP; Sat, 12 Nov 2016 03:24:01 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E3CE8C04B957; Sat, 12 Nov 2016 03:23:59 +0000 (UTC) Received: from localhost (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAC3NwVd021225; Fri, 11 Nov 2016 22:23:59 -0500 Date: Sat, 12 Nov 2016 03:23:57 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] Use shared_ptr::element_type in hash specializations Message-ID: <20161112032357.GA2194@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.1 (2016-10-04) Some tweaks I missed from the preparing-shared_ptr-for-arrays patch. * include/bits/shared_ptr.h (hash>): Use element_type. * include/bits/shared_ptr_base.h (hash<__shared_ptr>): Likewise. Tested powerpc64le-linux, committed to trunk. commit 6b13d2ff4a8528fb663c855da0d11d5992120288 Author: Jonathan Wakely Date: Fri Nov 11 05:15:54 2016 +0000 Use shared_ptr::element_type in hash specializations * include/bits/shared_ptr.h (hash>): Use element_type. * include/bits/shared_ptr_base.h (hash<__shared_ptr>): Likewise. diff --git a/libstdc++-v3/include/bits/shared_ptr.h b/libstdc++-v3/include/bits/shared_ptr.h index 9f7a40c..e562a42 100644 --- a/libstdc++-v3/include/bits/shared_ptr.h +++ b/libstdc++-v3/include/bits/shared_ptr.h @@ -692,7 +692,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { size_t operator()(const shared_ptr<_Tp>& __s) const noexcept - { return std::hash<_Tp*>()(__s.get()); } + { + return std::hash::element_type*>()(__s.get()); + } }; // @} group pointer_abstractions diff --git a/libstdc++-v3/include/bits/shared_ptr_base.h b/libstdc++-v3/include/bits/shared_ptr_base.h index 1a9e3e9..5e344b8 100644 --- a/libstdc++-v3/include/bits/shared_ptr_base.h +++ b/libstdc++-v3/include/bits/shared_ptr_base.h @@ -1681,7 +1681,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { size_t operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept - { return std::hash<_Tp*>()(__s.get()); } + { + return hash::element_type*>()( + __s.get()); + } }; _GLIBCXX_END_NAMESPACE_VERSION