From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id EE43C384F4AF for ; Mon, 21 Nov 2022 18:51:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EE43C384F4AF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669056679; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=MRjEiZ7wUY3XUlAxRBHoSNeG7an9wnuCafF4RFJfEFo=; b=HpaSECGVUyxaTpa1flpjR1WtoHR0wyGcH/UDvNtJ/XrYqtfpm4LEVhsvdgY/QzekbtHS0i O0qUiYM6kOJj4aP/0DK0eguvbfmzyLDjZGbLcMb1EmR6zhcfujn14bmuU4zMhFVIy489Iw XJ7D8dJaS0olxDOkm6xakSvHP9YlOKI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-134-h70zcJxrMNiH1AonW7LpTg-1; Mon, 21 Nov 2022 13:51:17 -0500 X-MC-Unique: h70zcJxrMNiH1AonW7LpTg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3ED3A800B23; Mon, 21 Nov 2022 18:51:17 +0000 (UTC) Received: from localhost (unknown [10.33.36.60]) by smtp.corp.redhat.com (Postfix) with ESMTP id 047C2492B06; Mon, 21 Nov 2022 18:51:16 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Improve Doxygen comments in Date: Mon, 21 Nov 2022 18:51:15 +0000 Message-Id: <20221121185115.2021818-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tested x86_64-linux. Pushed to trunk. -- >8-- libstdc++-v3/ChangeLog: * include/std/tuple: Add better Doxygen comments. --- libstdc++-v3/include/std/tuple | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 26e248431ec..0ac592d8d94 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1980,6 +1980,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // three_way_comparison // NB: DR 705. + /// Create a tuple containing copies of the arguments template constexpr tuple::__type...> make_tuple(_Elements&&... __args) @@ -1991,7 +1992,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2275. Why is forward_as_tuple not constexpr? - /// std::forward_as_tuple + /// Create a tuple of lvalue or rvalue references to the arguments template constexpr tuple<_Elements&&...> forward_as_tuple(_Elements&&... __args) noexcept @@ -2018,7 +2019,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr const _Tp&& get(const array<_Tp, _Nm>&&) noexcept; - + /// @cond undocumented template struct __make_tuple_impl; @@ -2130,8 +2131,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template struct __is_tuple_like_impl> : true_type { }; + /// @endcond - /// tuple_cat + /// Create a `tuple` containing all elements from multiple tuple-like objects template...>::value>::type> constexpr auto @@ -2146,13 +2148,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2301. Why is tie not constexpr? - /// tie + /// Return a tuple of lvalue references bound to the arguments template constexpr tuple<_Elements&...> tie(_Elements&... __args) noexcept { return tuple<_Elements&...>(__args...); } - /// swap + /// Exchange the values of two tuples template _GLIBCXX20_CONSTEXPR inline @@ -2177,6 +2179,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION #endif // C++23 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 + /// Exchange the values of two const tuples (if const elements can be swapped) template _GLIBCXX20_CONSTEXPR typename enable_if...>::value>::type @@ -2197,6 +2200,21 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // _GLIBCXX_RESOLVE_LIB_DEFECTS // 2773. Making std::ignore constexpr + /** Used with `std::tie` to ignore an element of a tuple + * + * When using `std::tie` to assign the elements of a tuple to variables, + * unwanted elements can be ignored by using `std::ignore`. For example: + * + * ``` + * int x, y; + * std::tie(x, std::ignore, y) = std::make_tuple(1, 2, 3); + * ``` + * + * This assignment will perform `x=1; std::ignore=2; y=3;` which results + * in the second element being ignored. + * + * @since C++11 + */ _GLIBCXX17_INLINE constexpr _Swallow_assign ignore{}; /// Partial specialization for tuples -- 2.38.1