From patchwork Fri Nov 13 11:31:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 544252 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 E0C3714141E for ; Fri, 13 Nov 2015 22:31:37 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=tBzlUF1s; 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=TX/1ejnRf4/spjtIa Qx5h6Zu0ak75CjwCbQ3uT4v5+xMJtGAMsKFt/uCRTrgk+ugwCAjR53256OhqEzHO E5861opCKEpe5hI21pDTakVxwsyWXxgFbe52VlM18dE2/pGU3UEi+yHi6Tb9YJkT oY1HELsx3mZjMpWf0Ip8P5Bhac= 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:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=PEnfF222dJNlAU5nZNmETiy 9thE=; b=tBzlUF1smgbpy5aFqyYGVqCSO+L+GpsX1DC8cyGFU5zAE/19J5JyScN qrctHhu6ZbZIkSltQOJ145tuAn10tJ6GWm8Rv8yc+Q/fzAqb9j+fMjMT1py0k3RV hQxhFSUlI1387+5exfwYVu4Uiplr666CLvyMVYLWT6CECJ3qtT4w= Received: (qmail 68954 invoked by alias); 13 Nov 2015 11:31:22 -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 64877 invoked by uid 89); 13 Nov 2015 11:31:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_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; Fri, 13 Nov 2015 11:31:17 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 23E04C6DB0; Fri, 13 Nov 2015 11:31:16 +0000 (UTC) Received: from localhost (ovpn-116-102.ams2.redhat.com [10.36.116.102]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tADBVFm3010148; Fri, 13 Nov 2015 06:31:15 -0500 Date: Fri, 13 Nov 2015 11:31:14 +0000 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Fan You , Tim Shen Subject: Re: [patch] GSoC: Implement std::experimental::shared_ptr Message-ID: <20151113113114.GN2937@redhat.com> References: <20151113110931.GM2937@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20151113110931.GM2937@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) On 13/11/15 11:09 +0000, Jonathan Wakely wrote: >This is the other piece of work done by Fan You for the Google Summer >of Code (and mentored by Tim). > >This implements experimental::shared_ptr from the Library Fundamentals >TS, which differs from std::shared_ptr by supporting arrays, i.e. >shared_ptr and shared_ptr behave correctly, using >delete[] to free the managed memory, and providing operator[] instead >of operator* and operator->. > >I made a few changes to Fan You's patch: > >- moved __libfund_v1 tag type and new partial specializations to > , so all changes are in the experimental dir. > >- added a second template parameter to the tag type to distinguish > arrays from non-arrays, so we can have two partial specializations, > __shared_ptr<__libfund_v1> and __shared_ptr<__libfund_v1 false>>, with slightly different interfaces. > >- added std::hash specialization. > >- used remove_extent_t, enable_if_t etc alias templates. > >- removed the _Weak_friend helper class. > >- fixed some tests that used operator-> on shared_ptr. > > >Thanks very much to Fan You, and to TIm Shen and Google. > >Tested powerpc64le-linux, committed to trunk. Oops, I made a small error in the doxygen @file comment, fixed with this patch. Committed to trunk. commit 5fb8a8b7401e0374d34574db0398639b84c36b6e Author: Jonathan Wakely Date: Fri Nov 13 11:16:51 2015 +0000 * include/experimental/bits/shared_ptr.h: Tweak comments. diff --git a/libstdc++-v3/include/experimental/bits/shared_ptr.h b/libstdc++-v3/include/experimental/bits/shared_ptr.h index feba7d7..413652d 100644 --- a/libstdc++-v3/include/experimental/bits/shared_ptr.h +++ b/libstdc++-v3/include/experimental/bits/shared_ptr.h @@ -24,7 +24,7 @@ /** @file experimental/bits/shared_ptr.h * This is an internal header file, included by other library headers. - * Do not attempt to use it directly. @headername{memory} + * Do not attempt to use it directly. @headername{experimental/memory} */ #ifndef _GLIBCXX_EXPERIMENTAL_SHARED_PTR_H @@ -57,7 +57,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION /* * The specification of std::experimental::shared_ptr is slightly different - * to std::shared_ptr (specifically in terms of pointer "compatibility") so + * to std::shared_ptr (specifically in terms of "compatible" pointers) so * to implement std::experimental::shared_ptr without too much duplication * we make it derive from a partial specialization of std::__shared_ptr * using a special tag type, __libfund_v1.