220 37205 <e3415a75-7e20-48dd-9e24-0e4681f46e53@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Vincent Reverdy <vince.rev@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: General purpose utilities for template
 metaprogramming and type manipulation
Date: Sat, 3 Mar 2018 22:55:38 -0800 (PST)
Lines: 142
Approved: news@gmane.org
Message-ID: <e3415a75-7e20-48dd-9e24-0e4681f46e53@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_10232_1978397646.1520146538613"
X-Trace: blaine.gmane.org 1520146419 25433 195.159.176.226 (4 Mar 2018 06:53:39 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 4 Mar 2018 06:53:39 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCYPFAORZMKRB25Q53KAKGQE646EPEI@isocpp.org Sun Mar 04 07:53:35 2018
Return-path: <std-proposals+bncBCYPFAORZMKRB25Q53KAKGQE646EPEI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ua0-f197.google.com ([209.85.217.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCYPFAORZMKRB25Q53KAKGQE646EPEI@isocpp.org>)
	id 1esNWY-0005xg-3V
	for gclcip-std-proposals@m.gmane.org; Sun, 04 Mar 2018 07:53:34 +0100
Original-Received: by mail-ua0-f197.google.com with SMTP id d35sf8845281uag.0
        for <gclcip-std-proposals@m.gmane.org>; Sat, 03 Mar 2018 22:55:41 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=g9x7hXym8IGkXo/roy5+rU3H/LXVQ+oykGk8o64oHck=;
        b=Vn1JvXsv/kYtCgcS/l7z5mVcwm+DUW/7ebWrpRGSX5T1Hc113OinofCSSr9NkJZzY5
         qN8a2dR4taFfWSshXKWUU2TFeNCo+DYXApIQSb0rixSy7/sMU9CLfHeKtUmtK3BckH9A
         aj7zLSarClQvzOlGXMv35iBE9+AL6fQQdpHfTLZOVvA3+VjS4KcNeqB8cloOOpBIobUN
         qbr+5tXGH3GAlcT/v0FRtcrKfzm8wOJOnRUJm8Q3Utl6/TMIs0haLc6LaptKBBwH2x77
         jiu43KXDV2TtROjEhJBk1YGlr83eMbktzATWtElKvjmsG2iInNJBEP48wlz53apZhhEM
         kSpg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to:message-id:subject:mime-version:x-original-sender
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=g9x7hXym8IGkXo/roy5+rU3H/LXVQ+oykGk8o64oHck=;
        b=PzvGjT4OecRHLrgaf7ojgPOH8Q92FvZWy1d02YmTx+hRvzDT9S1zswzCE9hhPaNrD/
         xy9Sm6Ra5sF+N/hvr66g+nYP0OEhpb02w/2/UIewvxNw8o8+sWjYfrMuDnsOVo6Stqfi
         fyjjSPbH4f2LMF2vUnadndXPgoOwFzFNS4DLsivamr9GkNKa5YtxoxqsODdatcpMRnhM
         zXdIzoaz2gAzrnEf1Ozf637xSHIvYvpzGW1EpZDAhehgJNdcx0wjQ35RDhn9Ts6lYvAk
         2647/iTXoW8ji5mZSmON8Rz3ToCZpEHOZrMv0xnrVaL/iCM5Mtkw5KPSKq/0Jey/iyTt
         cHuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:date:from:to:message-id:subject:mime-version
         :x-original-sender:reply-to:precedence:mailing-list:list-id
         :x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=g9x7hXym8IGkXo/roy5+rU3H/LXVQ+oykGk8o64oHck=;
        b=MjZSuGYIo1WaIcc/QTcT9NySHaHIpa4oXRaH9Apx/5X7KirZvQaunwLZAGqY3GiqpY
         8LBXFTEg2WaP2elu6RN5VCYp2jIqjj4H8S22xOfSJsqXsMoMrLQQu4PDNuSZc7jpwE3F
         qlxvdydNmh+EWd516iPXlM8GMCGeQISBaU/rIUZTg2JRIEJo5WA9MNNESB0cf1hdWKlw
         pGtEAMOtT/WP8nrCECdu5R2wyTNiTaWNjxeM3m1P3DAspPK/0AXObWWZoU06cD/mfZ5/
         FrR4KNmwd+z6Z4AXknhLh8ipFBY49vj33ZRQnoVnDXvbJq5OVXszPrJ8Vkupdo6CP30D
         mhpw==
X-Gm-Message-State: APf1xPDT5yiNBwcSIln/6I/coqFItR8J+h1lERL8GYYESuBf6RuWtwgz
	jOfRR+dUFonjCLuNqQGIcKPRnQ==
X-Google-Smtp-Source: AG47ELtOqWlAhysiBJI5lPGuUdlHyKEEV3MW/UaRRruIq4/FsvWGK/WJ+6VKkp0t0tWD75O4CBQ73A==
X-Received: by 10.31.168.8 with SMTP id r8mr5242284vke.51.1520146540570;
        Sat, 03 Mar 2018 22:55:40 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.31.205.194 with SMTP id d185ls7400199vkg.20.gmail; Sat, 03 Mar
 2018 22:55:39 -0800 (PST)
X-Received: by 10.31.161.197 with SMTP id k188mr1199897vke.8.1520146539105;
        Sat, 03 Mar 2018 22:55:39 -0800 (PST)
X-Original-Sender: Vince.Rev@gmail.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:37205
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/37205>

------=_Part_10232_1978397646.1520146538613
Content-Type: multipart/alternative; 
	boundary="----=_Part_10233_2019831081.1520146538613"

------=_Part_10233_2019831081.1520146538613
Content-Type: text/plain; charset="UTF-8"

Hey,

I was starting to think about putting together a proposal to add minor 
helper classes to either type_traits/utility/tuple to help with some of the 
operations done again and again when doing template metaprogramming.
Here is a list of a few I can think of, but I would have liked to hear 
other suggestions. Names are just indicative, and bikeshedding would happen 
for all of these types.


   - *std::blank*, defined as an empty struct 
   struct blank{};
   - *std::pack*, to hold a parameter pack of type
   template <class... T> struct pack{};
   - *std::convertible*, a type convertible to anything
   struct convertible{template <class T> constexpr operator T() const 
   noexcept;};
   - *std::copy_qualifiers*, a type traits copying ref and cv qualifiers 
   from one type to another
   template <class From, class To> struct copy_qualifiers {using type = /* 
   cv-ref qualfiers of From applied to To*/;};
   
Other suggestions?

-- 
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.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/e3415a75-7e20-48dd-9e24-0e4681f46e53%40isocpp.org.

------=_Part_10233_2019831081.1520146538613
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hey,<br><br>I was starting to think about putting together=
 a proposal to add minor helper classes to either type_traits/utility/tuple=
 to help with some of the operations done again and again when doing templa=
te metaprogramming.<br>Here is a list of a few I can think of, but I would =
have liked to hear other suggestions. Names are just indicative, and bikesh=
edding would happen for all of these types.<br><br><ul><li><b>std::blank</b=
>, defined as an empty struct <div style=3D"background-color: rgb(250, 250,=
 250); border-color: rgb(187, 187, 187); border-style: solid; border-width:=
 1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"pret=
typrint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=
=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> blank</span><span style=3D"color: #660;" class=3D"styl=
ed-by-prettify">{};</span></div></code></div></li><li><b>std::pack</b>, to =
hold a parameter pack of type<div style=3D"background-color: rgb(250, 250, =
250); border-color: rgb(187, 187, 187); border-style: solid; border-width: =
1px; overflow-wrap: break-word;" class=3D"prettyprint"><code class=3D"prett=
yprint"><div class=3D"subprettyprint"><span style=3D"color: #008;" class=3D=
"styled-by-prettify">template</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">class</span><span style=3D"color: #660;" class=3D"styled-by-prettify">.=
...</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> T</span=
><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> pack</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">{};</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"><br></span></div></code></div></li><li><b>std::=
convertible</b>, a type convertible to anything<div style=3D"background-col=
or: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: sol=
id; border-width: 1px; overflow-wrap: break-word;" class=3D"prettyprint"><c=
ode class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"colo=
r: #008;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> convertible</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">template</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">&lt;</span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">class</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> T</span><span style=3D"color: #660;" class=3D"styled-by-prettify">&g=
t;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">operator</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> T</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">()</span><span style=3D"color: #000;=
" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> noexcept</span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">;};</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span></div></code></div></li><li><b>std::copy_qualifiers</=
b>, a type traits copying ref and cv qualifiers from one type to another<co=
de class=3D"prettyprint"><div class=3D"subprettyprint"><div style=3D"backgr=
ound-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-st=
yle: solid; border-width: 1px; overflow-wrap: break-word;" class=3D"prettyp=
rint"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #008;" class=3D"styled-by-prettify">template</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">&lt;</span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">class</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"st=
yled-by-prettify">From</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">,</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">class<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">To</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">&gt;</span><span style=3D"co=
lor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008=
;" class=3D"styled-by-prettify">struct</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> copy_qualifiers </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">using</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> type </span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify"=
>/* cv-ref qualfiers of From applied to To*/</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">;};</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"><br></span></div></code></div><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"></span></div></code></li></ul><p>Ot=
her suggestions?<br></p></div>

<p></p>

-- <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 />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/e3415a75-7e20-48dd-9e24-0e4681f46e53%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e3415a75-7e20-48dd-9e24-0e4681f46e53=
%40isocpp.org</a>.<br />

------=_Part_10233_2019831081.1520146538613--

------=_Part_10232_1978397646.1520146538613--

.
