220 15452 <CAB+4KH+0Zy1hfW6baW2kEWT+Lw7H53yd7UQGZMf0MpfC19WpCw@mail.gmail.com> article
Path: news.gmane.org!not-for-mail
From: Andrew Tomazos <andrewtomazos@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Adding a remove_cv_reference type trait
Date: Sun, 4 Jan 2015 21:27:30 +0100
Lines: 134
Approved: news@gmane.org
Message-ID: <CAB+4KH+0Zy1hfW6baW2kEWT+Lw7H53yd7UQGZMf0MpfC19WpCw@mail.gmail.com>
References: <5880acc5-8236-40a0-bd5d-dfa6d9284572@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary=001a11c36c682acece050bd96753
X-Trace: ger.gmane.org 1420403259 28083 80.91.229.3 (4 Jan 2015 20:27:39 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 4 Jan 2015 20:27:39 +0000 (UTC)
To: "std-proposals@isocpp.org" <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBD5KHQXXWYPRBM6EU2SQKGQEUPEYHVY@isocpp.org Sun Jan 04 21:27:33 2015
Return-path: <std-proposals+bncBD5KHQXXWYPRBM6EU2SQKGQEUPEYHVY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-la0-f70.google.com ([209.85.215.70])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBD5KHQXXWYPRBM6EU2SQKGQEUPEYHVY@isocpp.org>)
	id 1Y7rlt-0000yc-9n
	for gclcip-std-proposals@m.gmane.org; Sun, 04 Jan 2015 21:27:33 +0100
Original-Received: by mail-la0-f70.google.com with SMTP id hs14sf11580311lab.9
        for <gclcip-std-proposals@m.gmane.org>; Sun, 04 Jan 2015 12:27:32 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:mime-version:in-reply-to:references:date
         :message-id:subject:from:to:content-type:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=d/q2xByPgIth87uVYbktawqdsJL1hFQS9lgCYZ27O2A=;
        b=FoC3e+KT9fjzHoHijmqAbqo8a+xbSBrRchgV2LK+ToEB3hVLBhBO1aO2esaNbY/yA7
         nweG4G1/RhvE7LQTPZ92Mr89TmM0rXCmDgR6gqGTh6XoBeN3JWo74cqR1QL4oBMX0yH9
         rx6d3uyg0lD1foZj8og/qhWADu0o2Lf9KeRleV0ruoSEPscBOMPCGp6Tny7rS6bvXFzP
         NOHiiiTxdyG51UkHgy1nRJ6um/3unO+sDRSUs79pxsvMBLl9c7+f4y8yEl2Xs88L/8Er
         rN79DoXxCazDxaIOqw62ZRs4Sn9o2t98Qovh9QXNeWP0JYqoJhC41FAE8izr1R/wjWUn
         zpHg==
X-Gm-Message-State: ALoCoQlJ6RrNSXYJ5nrrDdTvvBYeah34n3peOsq/wLTg7yXbiW9FMfup9TT1QxEjvtBMQiYSdBm8
X-Received: by 10.112.171.74 with SMTP id as10mr2340lbc.8.1420403252698;
        Sun, 04 Jan 2015 12:27:32 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.5.74 with SMTP id q10ls2561717laq.43.gmail; Sun, 04 Jan
 2015 12:27:30 -0800 (PST)
X-Received: by 10.112.189.38 with SMTP id gf6mr40595038lbc.65.1420403250759;
        Sun, 04 Jan 2015 12:27:30 -0800 (PST)
Original-Received: from mail-lb0-x231.google.com (mail-lb0-x231.google.com. [2a00:1450:4010:c04::231])
        by mx.google.com with ESMTPS id x7si59572169lae.100.2015.01.04.12.27.30
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);
        Sun, 04 Jan 2015 12:27:30 -0800 (PST)
Received-SPF: pass (google.com: domain of andrewtomazos@gmail.com designates 2a00:1450:4010:c04::231 as permitted sender) client-ip=2a00:1450:4010:c04::231;
Original-Received: by mail-lb0-f177.google.com with SMTP id b6so16816195lbj.36
        for <std-proposals@isocpp.org>; Sun, 04 Jan 2015 12:27:30 -0800 (PST)
X-Received: by 10.112.171.199 with SMTP id aw7mr87378031lbc.40.1420403250219;
 Sun, 04 Jan 2015 12:27:30 -0800 (PST)
Original-Received: by 10.25.211.16 with HTTP; Sun, 4 Jan 2015 12:27:30 -0800 (PST)
In-Reply-To: <5880acc5-8236-40a0-bd5d-dfa6d9284572@isocpp.org>
X-Original-Sender: andrewtomazos@gmail.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of andrewtomazos@gmail.com designates 2a00:1450:4010:c04::231 as
 permitted sender) smtp.mail=andrewtomazos@gmail.com;       dkim=pass
 header.i=@gmail.com;       dmarc=pass (p=NONE dis=NONE) header.from=gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:15452
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15452>

--001a11c36c682acece050bd96753
Content-Type: text/plain; charset=UTF-8

std::decay does this, as well as array-to-pointer and function-to-pointer.

On Sun, Jan 4, 2015 at 7:33 PM, <R.HL@gmx.net> wrote:

> There is a generally useful type trait not yet included in the standard
> library, simply removing all references and cv-qualifiers from a type -
> i.e. it maps
> int const&     to    int
> int&&          to    int
> and so forth. This trait could be named remove_cv_reference. The
> implementation is trivial, e.g.
> template <typename T>
> struct remove_cv_reference { using type = remove_cv_t<remove_reference_t<T
> >>; };
>
> template <typename T>
> struct remove_cv_reference_t = typename remove_cv_reference<T>::type;
> Is it feasible to include this in <type_traits>?
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11c36c682acece050bd96753
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">std::decay does this, as well as array-to-pointer and func=
tion-to-pointer.</div><div class=3D"gmail_extra"><br><div class=3D"gmail_qu=
ote">On Sun, Jan 4, 2015 at 7:33 PM,  <span dir=3D"ltr">&lt;<a href=3D"mail=
to:R.HL@gmx.net" target=3D"_blank">R.HL@gmx.net</a>&gt;</span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div dir=3D"ltr">There is a generally useful t=
ype trait not yet included in the standard library, simply removing all ref=
erences and cv-qualifiers from a type - i.e. it maps<div style=3D"border:1p=
x solid rgb(187,187,187);word-wrap:break-word;background-color:rgb(250,250,=
250)"><code><span style=3D"color:rgb(0,0,136)">int</span><span style=3D"col=
or:rgb(0,0,0)">=C2=A0</span><span style=3D"color:rgb(0,0,136)">const</span>=
<span style=3D"color:rgb(102,102,0)">&amp;</span><span style=3D"color:rgb(0=
,0,0)">=C2=A0=C2=A0 =C2=A0 to =C2=A0 =C2=A0</span><span style=3D"color:rgb(=
0,0,136)">int</span><span style=3D"color:rgb(0,0,0)"><br></span><span style=
=3D"color:rgb(0,0,136)">int</span><span style=3D"color:rgb(102,102,0)">&amp=
;&amp;</span><span style=3D"color:rgb(0,0,0)">=C2=A0=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0to =C2=A0 =C2=A0</span><span style=3D"color:rgb(0,0,136)">int<=
/span><span style=3D"color:rgb(0,0,0)"><br></span></code></div><div>and so =
forth. This trait could be named=C2=A0<font face=3D"courier new, monospace"=
>remove_cv_reference</font><font face=3D"arial, sans-serif">.</font>=C2=A0T=
he implementation is trivial, e.g.</div><div style=3D"border:1px solid rgb(=
187,187,187);word-wrap:break-word;background-color:rgb(250,250,250)"><code>=
<span style=3D"color:rgb(0,0,136)">template</span><span style=3D"color:rgb(=
0,0,0)">=C2=A0</span><span style=3D"color:rgb(102,102,0)">&lt;</span><span =
style=3D"color:rgb(0,0,136)">typename</span><span style=3D"color:rgb(0,0,0)=
">=C2=A0T</span><span style=3D"color:rgb(102,102,0)">&gt;</span><span style=
=3D"color:rgb(0,0,0)"><br></span><span style=3D"color:rgb(0,0,136)">struct<=
/span><span style=3D"color:rgb(0,0,0)">=C2=A0remove_cv_reference=C2=A0</spa=
n><span style=3D"color:rgb(102,102,0)">{</span><span style=3D"color:rgb(0,0=
,0)">=C2=A0</span><span style=3D"color:rgb(0,0,136)">using</span><span styl=
e=3D"color:rgb(0,0,0)">=C2=A0type=C2=A0</span><span style=3D"color:rgb(102,=
102,0)">=3D</span><span style=3D"color:rgb(0,0,0)">=C2=A0remove_cv_t</span>=
<span style=3D"color:rgb(102,102,0)">&lt;</span><span style=3D"color:rgb(0,=
0,0)">remove_reference_t</span><span style=3D"color:rgb(102,102,0)"><u></u>=
&lt;</span><span style=3D"color:rgb(0,0,0)">T</span><span style=3D"color:rg=
b(102,102,0)">&gt;&gt;;</span><span style=3D"color:rgb(0,0,0)">=C2=A0</span=
><span style=3D"color:rgb(102,102,0)">};</span><span style=3D"color:rgb(0,0=
,0)"><br><br></span><span style=3D"color:rgb(0,0,136)">template</span><span=
 style=3D"color:rgb(0,0,0)">=C2=A0</span><span style=3D"color:rgb(102,102,0=
)">&lt;</span><span style=3D"color:rgb(0,0,136)">typename</span><span style=
=3D"color:rgb(0,0,0)">=C2=A0T</span><span style=3D"color:rgb(102,102,0)">&g=
t;</span><span style=3D"color:rgb(0,0,0)"><br></span><span style=3D"color:r=
gb(0,0,136)">struct</span><span style=3D"color:rgb(0,0,0)">=C2=A0remove_cv_=
reference_t=C2=A0</span><span style=3D"color:rgb(102,102,0)">=3D</span><spa=
n style=3D"color:rgb(0,0,0)">=C2=A0</span><span style=3D"color:rgb(0,0,136)=
">typename</span><span style=3D"color:rgb(0,0,0)">=C2=A0remove_cv_reference=
</span><span style=3D"color:rgb(102,102,0)">&lt;</span><span style=3D"color=
:rgb(0,0,0)">T</span><span style=3D"color:rgb(102,102,0)">&gt;::</span><spa=
n style=3D"color:rgb(0,0,0)">type</span><span style=3D"color:rgb(102,102,0)=
">;</span></code></div><div>Is it feasible to include this in <font face=3D=
"courier new, monospace">&lt;type_traits&gt;</font>?</div></div><span class=
=3D"HOEnZb"><font color=3D"#888888">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</font></span></blockquote></div><br></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c36c682acece050bd96753--

.
