220 15450 <5880acc5-8236-40a0-bd5d-dfa6d9284572@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: R.HL@gmx.net
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Adding a remove_cv_reference type trait
Date: Sun, 4 Jan 2015 10:33:47 -0800 (PST)
Lines: 103
Approved: news@gmane.org
Message-ID: <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/mixed; 
	boundary="----=_Part_3304_25283539.1420396427193"
X-Trace: ger.gmane.org 1420396440 27794 80.91.229.3 (4 Jan 2015 18:34:00 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 4 Jan 2015 18:34:00 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDRN5RPSR4MRBDEPU2SQKGQEK2FJDDI@isocpp.org Sun Jan 04 19:33:54 2015
Return-path: <std-proposals+bncBDRN5RPSR4MRBDEPU2SQKGQEK2FJDDI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ig0-f197.google.com ([209.85.213.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDRN5RPSR4MRBDEPU2SQKGQEK2FJDDI@isocpp.org>)
	id 1Y7pzp-0000Ke-QH
	for gclcip-std-proposals@m.gmane.org; Sun, 04 Jan 2015 19:33:49 +0100
Original-Received: by mail-ig0-f197.google.com with SMTP id r2sf13991774igi.4
        for <gclcip-std-proposals@m.gmane.org>; Sun, 04 Jan 2015 10:33:48 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :content-type:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe;
        bh=VR4s8uPFYODMQCRR0770YBIdZZ9eOsCZQc5qVSqUumk=;
        b=JKq0p39j1wQDL7MIQDmLF+DBxSkqLYO6roC6t6ZNzxt6D0bF56skEgEO2mRlXkQ5yP
         3MY6dWv1X4txSPxZjMZLieneNrlgJtHkR3+Qh4qz9WXYVMG7OZ57OZjH9IUheKK0rq2R
         D0m1dhWGE0IT7CHxC9JnGzSBafVKf3ZUiv10L9Y0dI2HC/csOtpV8VJI+cvPHJLRoT7U
         yd7Y1LYAaLzWfGAvNdS+fY4ehf4SrT8WIvr4aPj7N496x+yWejwQy9NL72h2ApCeC1f3
         1JgBa6LilakLpAuPSpGmEQUEAqQfA05S/OZl1ma+dczVyS3yZC2HRMAouj+XPJInxOzt
         sy9Q==
X-Gm-Message-State: ALoCoQkOlekgNeQbftQ7LjkUdfyIakSneVo6onaZqCmJKLtvOG6eU0URkMPfNYFU3ErI+HBLGvDM
X-Received: by 10.42.229.5 with SMTP id jg5mr65483610icb.23.1420396428829;
        Sun, 04 Jan 2015 10:33:48 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.95.75 with SMTP id h69ls2984257qge.92.gmail; Sun, 04 Jan
 2015 10:33:48 -0800 (PST)
X-Received: by 10.140.91.40 with SMTP id y37mr992qgd.11.1420396428098;
        Sun, 04 Jan 2015 10:33:48 -0800 (PST)
X-Original-Sender: R.HL@gmx.net
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:15450
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/15450>

------=_Part_3304_25283539.1420396427193
Content-Type: multipart/alternative; 
	boundary="----=_Part_3305_1886161514.1420396427193"

------=_Part_3305_1886161514.1420396427193
Content-Type: text/plain; charset=UTF-8

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/.

------=_Part_3305_1886161514.1420396427193
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">There is a generally useful type trait not yet included in=
 the standard library, simply removing all references and cv-qualifiers fro=
m a type - i.e. it maps<div style=3D"border: 1px solid rgb(187, 187, 187); =
word-wrap: break-word; background-color: rgb(250, 250, 250);"><code><span s=
tyle=3D"color: rgb(0, 0, 136);">int</span><span style=3D"color: rgb(0, 0, 0=
);">&nbsp;</span><span style=3D"color: rgb(0, 0, 136);">const</span><span s=
tyle=3D"color: rgb(102, 102, 0);">&amp;</span><span style=3D"color: rgb(0, =
0, 0);">&nbsp;&nbsp; &nbsp; to &nbsp; &nbsp;</span><span style=3D"color: rg=
b(0, 0, 136);">int</span><span style=3D"color: rgb(0, 0, 0);"><br></span><s=
pan style=3D"color: rgb(0, 0, 136);">int</span><span style=3D"color: rgb(10=
2, 102, 0);">&amp;&amp;</span><span style=3D"color: rgb(0, 0, 0);">&nbsp;&n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp;to &nbsp; &nbsp;</span><span style=3D"color=
: rgb(0, 0, 136);">int</span><span style=3D"color: rgb(0, 0, 0);"><br></spa=
n></code></div><div>and so forth. This trait could be named&nbsp;<font face=
=3D"courier new, monospace">remove_cv_reference</font><font face=3D"arial, =
sans-serif">.</font>&nbsp;The implementation is trivial, e.g.</div><div sty=
le=3D"border: 1px solid rgb(187, 187, 187); word-wrap: break-word; backgrou=
nd-color: rgb(250, 250, 250);"><code><span style=3D"color: rgb(0, 0, 136);"=
>template</span><span style=3D"color: rgb(0, 0, 0);">&nbsp;</span><span sty=
le=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);">&nbsp;T</span><s=
pan 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);">&nbsp;remove_cv_reference&nbsp;</span>=
<span style=3D"color: rgb(102, 102, 0);">{</span><span style=3D"color: rgb(=
0, 0, 0);">&nbsp;</span><span style=3D"color: rgb(0, 0, 136);">using</span>=
<span style=3D"color: rgb(0, 0, 0);">&nbsp;type&nbsp;</span><span style=3D"=
color: rgb(102, 102, 0);">=3D</span><span style=3D"color: rgb(0, 0, 0);">&n=
bsp;remove_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);"><wbr>&lt;</span><span style=3D"color: rgb(0, 0, =
0);">T</span><span style=3D"color: rgb(102, 102, 0);">&gt;&gt;;</span><span=
 style=3D"color: rgb(0, 0, 0);">&nbsp;</span><span style=3D"color: rgb(102,=
 102, 0);">};</span><span style=3D"color: rgb(0, 0, 0);"><br><br></span><sp=
an style=3D"color: rgb(0, 0, 136);">template</span><span style=3D"color: rg=
b(0, 0, 0);">&nbsp;</span><span style=3D"color: rgb(102, 102, 0);">&lt;</sp=
an><span style=3D"color: rgb(0, 0, 136);">typename</span><span style=3D"col=
or: rgb(0, 0, 0);">&nbsp;T</span><span style=3D"color: rgb(102, 102, 0);">&=
gt;</span><span style=3D"color: rgb(0, 0, 0);"><br></span><span style=3D"co=
lor: rgb(0, 0, 136);">struct</span><span style=3D"color: rgb(0, 0, 0);">&nb=
sp;remove_cv_reference_t&nbsp;</span><span style=3D"color: rgb(102, 102, 0)=
;">=3D</span><span style=3D"color: rgb(0, 0, 0);">&nbsp;</span><span style=
=3D"color: rgb(0, 0, 136);">typename</span><span style=3D"color: rgb(0, 0, =
0);">&nbsp;remove_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"c=
olor: rgb(102, 102, 0);">&gt;::</span><span style=3D"color: rgb(0, 0, 0);">=
type</span><span style=3D"color: rgb(102, 102, 0);">;</span></code></div><d=
iv>Is it feasible to include this in <font face=3D"courier new, monospace">=
&lt;type_traits&gt;</font>?</div></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 />

------=_Part_3305_1886161514.1420396427193--
------=_Part_3304_25283539.1420396427193--

.
