From patchwork Sat Jun 14 20:43:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 359799 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 8B07C1400E3 for ; Sun, 15 Jun 2014 06:43:38 +1000 (EST) 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=IPUv+Dvh2305K5tqbO+sxKZlwPpIA2mKPJHED6WPDvoTNsHenhAth iYIO37g0DMJT9AaMWH8swblhdBDUnDuKO4yUk02W6glxHqQtwubHZaG0ixOf72pi imoLEGMpWP8I3/1MJNf0hucSstvqmGnrxfepF2ThKuMtKAXChzdxlo= 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=ijmLyIUcCkI8JgOW7v7d6Zw7WMA=; b=o9ZoWmytNJ4DpWm3Lqjn LCC2o2jhdUeCJwpbe9nbk5DIyP0bwrhEGuDznMXu9ytFQC3rw0DwzskyIhArzvGH khMHebm/X6BJnyMXRWcrvMZLpVwngmbvBlYZI4FjgJ8E+ZvgDEeoizhNmAE65tAN mrt+Vc8a1Pih3A/iHENa1HM= Received: (qmail 27797 invoked by alias); 14 Jun 2014 20:43: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 27778 invoked by uid 89); 14 Jun 2014 20:43:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_20, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_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 ESMTP; Sat, 14 Jun 2014 20:43:19 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5EKhI96012747 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 14 Jun 2014 16:43:18 -0400 Received: from localhost (vpn1-7-243.ams2.redhat.com [10.36.7.243]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5EKhHf9028041; Sat, 14 Jun 2014 16:43:17 -0400 Date: Sat, 14 Jun 2014 21:43:16 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [patch] Improve some doxygen comments Message-ID: <20140614204316.GK30729@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) One last set of Doxygen-related updates for today. This removes some redundancy, moves std::bitset to the "Utilities" group in the docs (which is where it lives in the C++11 standard) and gets rid of the "Global I/O operators for bitsets" group, which only contained two operators for the dytnamic_bitset extension. Tested x86_64-linux, committed to trunk. commit 450e81f751bc2d8bac4cf9965fcda4b933eb3a61 Author: Jonathan Wakely Date: Sat Jun 14 21:26:32 2014 +0100 * include/experimental/any (any_cast): Combine duplicate doxygen comments. * include/experimental/string_view (basic_string_view): Update doxygen comment. * include/std/bitset (bitset): Move to Doxygen 'utilities' group. * include/tr2/dynamic_bitset (_Bool2UChar): Remove unused templates. (dynamic_bitset): Improve Doxygen comments. * include/tr2/dynamic_bitset.tcc (operator>>): Improve Doxygen comment. diff --git a/libstdc++-v3/include/experimental/any b/libstdc++-v3/include/experimental/any index 2839af1..1e8d9b2 100644 --- a/libstdc++-v3/include/experimental/any +++ b/libstdc++-v3/include/experimental/any @@ -81,11 +81,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @brief A type-safe container of any type. - * - * An @c any object's state is either empty or it stores a contained object - * of CopyConstructible type. - */ + * @brief A type-safe container of any type. + * + * An @c any object's state is either empty or it stores a contained object + * of CopyConstructible type. + */ class any { // Holds either pointer to a heap object or the contained object itself. @@ -391,6 +391,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @throw bad_any_cast If * __any.type() != typeid(remove_reference_t<_ValueType>) * + * + * @{ */ template inline _ValueType any_cast(any& __any) @@ -403,16 +405,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __throw_bad_any_cast(); } - /** - * @brief Access the contained object. - * - * @tparam _ValueType A reference or CopyConstructible type. - * @param __any The object to access. - * @return The contained object. - * @throw bad_any_cast If - * __any.type() != typeid(remove_reference_t<_ValueType>) - * - */ template inline _ValueType any_cast(any&& __any) { @@ -423,6 +415,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return *__p; __throw_bad_any_cast(); } + // @} /** * @brief Access the contained object. @@ -432,6 +425,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION * @return The address of the contained object if * __any != nullptr && __any.type() == typeid(_ValueType) * , otherwise a null pointer. + * + * @{ */ template inline const _ValueType* any_cast(const any* __any) noexcept @@ -441,15 +436,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return nullptr; } - /** - * @brief Access the contained object. - * - * @tparam _ValueType The type of the contained object. - * @param __any A pointer to the object to access. - * @return The address of the contained object if - * __any != nullptr && __any.type() == typeid(_ValueType) - * , otherwise a null pointer. - */ template inline _ValueType* any_cast(any* __any) noexcept { @@ -457,6 +443,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return static_cast<_ValueType*>(__any_caster<_ValueType>(__any)); return nullptr; } + // @} #ifdef __GXX_RTTI template diff --git a/libstdc++-v3/include/experimental/string_view b/libstdc++-v3/include/experimental/string_view index 49f46af..b54c9e8 100644 --- a/libstdc++-v3/include/experimental/string_view +++ b/libstdc++-v3/include/experimental/string_view @@ -49,11 +49,12 @@ namespace experimental _GLIBCXX_BEGIN_NAMESPACE_VERSION /** - * @class basic_string_view + * @class basic_string_view * @brief A non-owning reference to a string. * * @ingroup strings * @ingroup sequences + * @ingroup experimental * * @tparam _CharT Type of character * @tparam _Traits Traits for character type, defaults to diff --git a/libstdc++-v3/include/std/bitset b/libstdc++-v3/include/std/bitset index b89a283..c58da82 100644 --- a/libstdc++-v3/include/std/bitset +++ b/libstdc++-v3/include/std/bitset @@ -681,9 +681,10 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER #endif /** - * The %bitset class represents a @e fixed-size sequence of bits. + * @class bitset * - * @ingroup containers + * @brief The %bitset class represents a @e fixed-size sequence of bits. + * @ingroup utilities * * (Note that %bitset does @e not meet the formal requirements of a * container. Mainly, it lacks iterators.) diff --git a/libstdc++-v3/include/tr2/dynamic_bitset b/libstdc++-v3/include/tr2/dynamic_bitset index dba145b..755584f 100644 --- a/libstdc++-v3/include/tr2/dynamic_bitset +++ b/libstdc++-v3/include/tr2/dynamic_bitset @@ -47,28 +47,11 @@ namespace tr2 _GLIBCXX_BEGIN_NAMESPACE_VERSION /** - * Dynamic Bitset. + * @defgroup dynamic_bitset Dynamic Bitset. + * @ingroup extensions * - * See N2050, - * Proposal to Add a Dynamically Sizeable Bitset to the Standard Library. + * @{ */ -namespace __detail -{ - -template -class _Bool2UChar -{ - typedef T type; -}; - -template<> -class _Bool2UChar -{ -public: - typedef unsigned char type; -}; - -} /** * Base class, general case. @@ -372,14 +355,8 @@ public: /** * @brief The %dynamic_bitset class represents a sequence of bits. * - * @ingroup containers - * - * (Note that %dynamic_bitset does @e not meet the formal - * requirements of a container. - * Mainly, it lacks iterators.) - * - * The template argument, @a Nb, may be any non-negative number, - * specifying the number of bits (e.g., "0", "12", "1024*1024"). + * See N2050, + * Proposal to Add a Dynamically Sizeable Bitset to the Standard Library. * * In the general unoptimized case, storage is allocated in * word-sized blocks. Let B be the number of bits in a word, then @@ -409,7 +386,7 @@ public: * int main() * { * long a = 'a'; - * dynamic_bitset b(a); + * dynamic_bitset<> b(a); * * cout << "b('a') is " << b << endl; * @@ -421,10 +398,6 @@ public: * } * @endcode * - * Also see: - * http://gcc.gnu.org/onlinedocs/libstdc++/manual/bk01pt12ch33s02.html - * for a description of extensions. - * * Most of the actual code isn't contained in %dynamic_bitset<> * itself, but in the base class __dynamic_bitset_base. The base * class works with whole words, not with individual bits. This @@ -1228,16 +1201,7 @@ public: } //@} - /** - * @defgroup Global I/O operators for bitsets. - * @{ - * @brief Global I/O operators for bitsets. - * - * Direct I/O between streams and bitsets is supported. Output is - * straightforward. Input will skip whitespace and only accept '0' - * and '1' characters. The %dynamic_bitset will grow as necessary - * to hold the string of bits. - */ + /// Stream output operator for dynamic_bitset. template inline std::basic_ostream<_CharT, _Traits>& diff --git a/libstdc++-v3/include/tr2/dynamic_bitset.tcc b/libstdc++-v3/include/tr2/dynamic_bitset.tcc index d5b55ce..25f897e 100644 --- a/libstdc++-v3/include/tr2/dynamic_bitset.tcc +++ b/libstdc++-v3/include/tr2/dynamic_bitset.tcc @@ -195,14 +195,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } /** - * @defgroup Global I/O operators for bitsets. - * @{ - * @brief Global I/O operators for bitsets. + * @brief Stream input operator for dynamic_bitset. + * @ingroup dynamic_bitset * - * Direct I/O between streams and bitsets is supported. Output is - * straightforward. Input will skip whitespace and only accept '0' - * and '1' characters. The %dynamic_bitset will grow as necessary - * to hold the string of bits. + * Input will skip whitespace and only accept '0' and '1' characters. + * The %dynamic_bitset will grow as necessary to hold the string of bits. */ template @@ -275,9 +272,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __is.setstate(__state); return __is; } - /** - * @} - */ _GLIBCXX_END_NAMESPACE_VERSION } // tr2