From patchwork Sat Jan 14 17:48:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 136082 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 CF398B6F7E for ; Sun, 15 Jan 2012 04:48:25 +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=1327168107; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=tL040Kr B0e9fS8yi/CvR34hG5Jk=; b=sj/YVRviitJs36GHJf2vUcgJjs4d+/bkjcL8ryV gUNDdYpHdK+5MNZ2JKfOI5ltIJXbSOXpUpWfJP0OAjPVe27q4MsTPS2QiXcPCtNX n04ajeSWTiKI409K3WByexdgiMAmCQec8ICNqmwTttuubKfheDwSWcuET2TUDuBv quyU= 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:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=EJj9/7Gjj0T6xP7YCNpRW5kAfvnOGursnSHgY5koNZRFlOaiX68nDBzgAYUfPN aqajcTKAzjzeqv98xE7EMpmZ6BdxhtWvmu7KqIg8SDDdRDpeDgh5/dn3kWVu53mG U7nw3QdL/ZEzBQj9GdHoAY3fOKJ/oJmrX5tf9W3bvWgt8=; Received: (qmail 10025 invoked by alias); 14 Jan 2012 17:48:21 -0000 Received: (qmail 10005 invoked by uid 22791); 14 Jan 2012 17:48:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-lpp01m010-f47.google.com (HELO mail-lpp01m010-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jan 2012 17:48:06 +0000 Received: by lami14 with SMTP id i14so885821lam.20 for ; Sat, 14 Jan 2012 09:48:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.48.193 with SMTP id o1mr1443746lbn.1.1326563284100; Sat, 14 Jan 2012 09:48:04 -0800 (PST) Received: by 10.112.8.69 with HTTP; Sat, 14 Jan 2012 09:48:04 -0800 (PST) Date: Sat, 14 Jan 2012 17:48:04 +0000 Message-ID: Subject: [v3] doxygen comments for reverse_iterator From: Jonathan Wakely To: "libstdc++" , gcc-patches 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 2012-01-14 Jonathan Wakely * include/bits/stl_iterator.h (reverse_iterator): Doxygen comments. Tested x86_64-linux, committed to trunk. --- a/libstdc++-v3/include/bits/stl_iterator.h +++ b/libstdc++-v3/include/bits/stl_iterator.h @@ -1,7 +1,7 @@ // Iterators -*- C++ -*- // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, -// 2010, 2011 +// 2010, 2011, 2012 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -114,7 +114,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename __traits_type::reference reference; /** - * The default constructor default-initializes member @p current. + * The default constructor value-initializes member @p current. * If it is a pointer, that means it is zero-initialized. */ // _GLIBCXX_RESOLVE_LIB_DEFECTS @@ -134,8 +134,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : current(__x.current) { } /** - * A reverse_iterator across other types can be copied in the normal - * fashion. + * A %reverse_iterator across other types can be copied if the + * underlying %iterator can be converted to the type of @c current. */ template reverse_iterator(const reverse_iterator<_Iter>& __x) @@ -149,9 +149,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return current; } /** - * @return TODO + * @return A reference to the value at @c --current * - * @doctodo + * This requires that @c --current is dereferenceable. + * + * @warning This implementation requires that for an iterator of the + * underlying iterator type, @c x, a reference obtained by + * @c *x remains valid after @c x has been modified or + * destroyed. This is a bug: http://gcc.gnu.org/PR51823 */ reference operator*() const @@ -161,18 +166,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return A pointer to the value at @c --current * - * @doctodo + * This requires that @c --current is dereferenceable. */ pointer operator->() const { return &(operator*()); } /** - * @return TODO + * @return @c *this * - * @doctodo + * Decrements the underlying iterator. */ reverse_iterator& operator++() @@ -182,9 +187,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return The original value of @c *this * - * @doctodo + * Decrements the underlying iterator. */ reverse_iterator operator++(int) @@ -195,9 +200,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return @c *this * - * @doctodo + * Increments the underlying iterator. */ reverse_iterator& operator--() @@ -207,9 +212,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return A reverse_iterator with the previous value of @c *this * - * @doctodo + * Increments the underlying iterator. */ reverse_iterator operator--(int) @@ -220,18 +225,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return A reverse_iterator that refers to @c current - @a __n * - * @doctodo + * The underlying iterator must be a Random Access Iterator. */ reverse_iterator operator+(difference_type __n) const { return reverse_iterator(current - __n); } /** - * @return TODO + * @return *this * - * @doctodo + * Moves the underlying iterator backwards @a __n steps. + * The underlying iterator must be a Random Access Iterator. */ reverse_iterator& operator+=(difference_type __n) @@ -241,18 +247,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return A reverse_iterator that refers to @c current - @a __n * - * @doctodo + * The underlying iterator must be a Random Access Iterator. */ reverse_iterator operator-(difference_type __n) const { return reverse_iterator(current + __n); } /** - * @return TODO + * @return *this * - * @doctodo + * Moves the underlying iterator forwards @a __n steps. + * The underlying iterator must be a Random Access Iterator. */ reverse_iterator& operator-=(difference_type __n) @@ -262,9 +269,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @return TODO + * @return The value at @c current - @a __n - 1 * - * @doctodo + * The underlying iterator must be a Random Access Iterator. */ reference operator[](difference_type __n) const