From 225eadc4f3676472836397c9c0449f3203ae0a6d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 01:51:39 -0700 Subject: [PATCH] P2968R2 Make std::ignore a first-class object --- source/utilities.tex | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 72a714d64a..d40af96736 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1494,6 +1494,11 @@ two arguments is similar to an instantiation of \tcode{pair} with the same two arguments. See~\ref{pairs}. +\pnum +In addition to being available via inclusion of the \libheader{tuple} header, +\tcode{ignore}\iref{tuple.syn} is available when +\libheader{utility}\iref{utility} is included. + \rSec2[tuple.syn]{Header \tcode{} synopsis} \indexheader{tuple}% @@ -1520,9 +1525,14 @@ template<@\exposconceptnc{tuple-like}@ TTuple, @\exposconceptnc{tuple-like}@ UTuple> struct common_type; - // \ref{tuple.creation}, tuple creation functions - inline constexpr @\unspec@ ignore; + // \tcode{ignore} + struct @\exposidnc{ignore-type}@ { // \expos + constexpr const @\exposid{ignore-type}@ + operator=(const auto &) const noexcept { return *this; } + }; + inline constexpr @\exposid{ignore-type}@ ignore; + // \ref{tuple.creation}, tuple creation functions template constexpr tuple...> make_tuple(TTypes&&...); @@ -2591,9 +2601,7 @@ \begin{itemdescr} \pnum \returns -\tcode{tuple(t...)}. When an -argument in \tcode{t} is \tcode{ignore}, assigning -any value to the corresponding tuple element has no effect. +\tcode{tuple(t...)}. \pnum \begin{example}