From patchwork Wed Mar 14 13:18:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 146614 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]) by ozlabs.org (Postfix) with SMTP id 848D8B6EE8 for ; Thu, 15 Mar 2012 00:22:14 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332336137; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Message-ID:Date:From:User-Agent:MIME-Version: To:CC:Subject:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=tpMuCjsxbP/uPCyCP0P9sLSGtGk=; b=K/U0PQAA7oJjXM3 GuHut6p7856A8mQrAfLFXXinOuzSnZcNl77AwF8pXriMQuqeuBv2A83jKsLRGsGr UNo2OAmm2dRMQ7ocjrK9xazBydyLOK3WBmsvwkRjp3vdj0ByjJI65gfPCBls3N88 JXKmQ/kjjlA3s+UOB/Qs297zHQTc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=CzKv0gOTdK2JzV7KYfT3dt1mHniHP0WM+dPAMJ0VtdWWYLYBSxUJp4+NfVyJV2 Zwp/SmX6WE37bslsLsfhJviodivmqDdMGjrEaFb3R7fYTLKc7cmRs0rO0oFvsTEI 03dKtftxl8HKTbPyTbDl6+nOox3Tzj4kTqx5rhvqJK8q0=; Received: (qmail 17340 invoked by alias); 14 Mar 2012 13:21:51 -0000 Received: (qmail 17323 invoked by uid 22791); 14 Mar 2012 13:21:48 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from acsinet15.oracle.com (HELO acsinet15.oracle.com) (141.146.126.227) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Mar 2012 13:21:35 +0000 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q2EDLXtU013860 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Mar 2012 13:21:34 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q2EDLXvZ018999 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Mar 2012 13:21:33 GMT Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q2EDLWri032303; Wed, 14 Mar 2012 08:21:32 -0500 Received: from [192.168.1.4] (/79.25.197.187) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 14 Mar 2012 06:21:32 -0700 Message-ID: <4F609AB7.3050206@oracle.com> Date: Wed, 14 Mar 2012 14:18:47 +0100 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Thunderbird/10.0.2 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" CC: libstdc++ Subject: [v3] Fix some comments in forward_list wrongly referring to size() X-IsSubscribed: yes 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 Hi, highly misleading. Committed to mainline (suitable for 4.7.1 too of course) Thanks, Paolo. /////////////////////// 2012-03-14 Paolo Carlini * include/bits/forward_list.h: Fix comments. Index: include/bits/forward_list.h =================================================================== --- include/bits/forward_list.h (revision 185379) +++ include/bits/forward_list.h (working copy) @@ -536,7 +536,8 @@ * @param __al An allocator object. * * Create a %forward_list consisting of copies of the elements - * in the initializer_list @a __il. This is linear in __il.size(). + * in the initializer_list @a __il. This is linear in the number + * of elements of __il. */ forward_list(std::initializer_list<_Tp> __il, const _Alloc& __al = _Alloc()) @@ -585,7 +586,7 @@ * * Replace the contents of the %forward_list with copies of the * elements in the initializer_list @a __il. This is linear in - * __il.size(). + * the number of elements of __il. */ forward_list& operator=(std::initializer_list<_Tp> __il) @@ -603,8 +604,8 @@ * in the range [@a __first,@a __last). * * Note that the assignment completely changes the %forward_list and - * that the resulting %forward_list's size is the same as the number - * of elements assigned. Old data may be lost. + * that the number of elements of the resulting %forward_list's is the + * same as the number of elements assigned. Old data is lost. */ template> @@ -620,10 +621,10 @@ * @param __n Number of elements to be assigned. * @param __val Value to be assigned. * - * This function fills a %forward_list with @a __n copies of the given - * value. Note that the assignment completely changes the - * %forward_list and that the resulting %forward_list's size is the - * same as the number of elements assigned. Old data may be lost. + * This function fills a %forward_list with @a __n copies of the + * given value. Note that the assignment completely changes the + * %forward_list, and that the resulting %forward_list has __n + * elements. Old data is lost. */ void assign(size_type __n, const _Tp& __val) @@ -742,7 +743,7 @@ { return this->_M_impl._M_head._M_next == 0; } /** - * Returns the largest possible size of %forward_list. + * Returns the largest possible number of elements of %forward_list. */ size_type max_size() const noexcept @@ -996,9 +997,9 @@ * * This function will %resize the %forward_list to the specified * number of elements. If the number is smaller than the - * %forward_list's current size the %forward_list is truncated, - * otherwise the %forward_list is extended and the new elements - * are default constructed. + * %forward_list's current number of elements the %forward_list + * is truncated, otherwise the %forward_list is extended and the + * new elements are default constructed. */ void resize(size_type __sz); @@ -1011,9 +1012,9 @@ * * This function will %resize the %forward_list to the specified * number of elements. If the number is smaller than the - * %forward_list's current size the %forward_list is truncated, - * otherwise the %forward_list is extended and new elements are - * populated with given data. + * %forward_list's current number of elements the %forward_list + * is truncated, otherwise the %forward_list is extended and new + * elements are populated with given data. */ void resize(size_type __sz, const value_type& __val); @@ -1233,11 +1234,11 @@ * @brief Forward list equality comparison. * @param __lx A %forward_list * @param __ly A %forward_list of the same type as @a __lx. - * @return True iff the size and elements of the forward lists are equal. + * @return True iff the elements of the forward lists are equal. * - * This is an equivalence relation. It is linear in the size of the - * forward lists. Deques are considered equivalent if corresponding - * elements compare equal. + * This is an equivalence relation. It is linear in the number of + * elements of the forward lists. Deques are considered equivalent + * if corresponding elements compare equal. */ template bool @@ -1250,8 +1251,9 @@ * @param __ly A %forward_list of the same type as @a __lx. * @return True iff @a __lx is lexicographically less than @a __ly. * - * This is a total ordering relation. It is linear in the size of the - * forward lists. The elements must be comparable with @c <. + * This is a total ordering relation. It is linear in the number of + * elements of the forward lists. The elements must be comparable + * with @c <. * * See std::lexicographical_compare() for how the determination is made. */