220 8430 <e96c896b-7f74-49ac-9967-a1a31c5b223e@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: inkwizytoryankes@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: A new keyword for either a type or a variable
 (typical use case for variadic template template)?
Date: Tue, 7 Jan 2014 12:05:33 -0800 (PST)
Lines: 191
Approved: news@gmane.org
Message-ID: <e96c896b-7f74-49ac-9967-a1a31c5b223e@isocpp.org>
References: <f4ec2cca-5951-447f-a938-0b2e5e3e233f@isocpp.org>
 <35db0731-9ff9-4e8a-ae2e-29e4974b46d8@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_10518_33012136.1389125133065"
X-Trace: ger.gmane.org 1389125129 30187 80.91.229.3 (7 Jan 2014 20:05:29 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Tue, 7 Jan 2014 20:05:29 +0000 (UTC)
Cc: hun.nemethpeter@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDDLTAGNTIBBBDV4WGLAKGQEV5GT2BQ@isocpp.org Tue Jan 07 21:05:37 2014
Return-path: <std-proposals+bncBDDLTAGNTIBBBDV4WGLAKGQEV5GT2BQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pb0-f69.google.com ([209.85.160.69])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDDLTAGNTIBBBDV4WGLAKGQEV5GT2BQ@isocpp.org>)
	id 1W0cu8-0001Z2-55
	for gclcip-std-proposals@m.gmane.org; Tue, 07 Jan 2014 21:05:36 +0100
Original-Received: by mail-pb0-f69.google.com with SMTP id md12sf1610013pbc.0
        for <gclcip-std-proposals@m.gmane.org>; Tue, 07 Jan 2014 12:05:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to:cc:message-id:in-reply-to:references:subject
         :mime-version:x-original-sender:reply-to:precedence:mailing-list
         :list-id:list-post:list-help:list-archive:list-subscribe
         :list-unsubscribe:content-type;
        bh=BpmqwM2OynsnTr1usKUOHEcmY1CX0UDNx2rOU/VD14Q=;
        b=mLRGrozqDuUEs5Y81ON5FNuUfJ5uzjVxw/0xqoUgvTkx0DYvY9Ky4h2EAQ9+7rGoL1
         t4WAhzjNWEyijp7YX/s7CbVVVxULIZt6x98wnZRq+/K6NfgyFBIelAxQSqLg5uN6Pqkl
         I6mYv0DNXJpQTNK0h2e+f3txn9IcblXVbLN1DbpwZFK4WCAQr0/ZtHtT29Us8XYm8OM1
         rwL7p9SpL0xw1I6ribdqZrjwMiegzGuMvbaVJAK8wxFC41uItBsOQ+MCI44/f2El78tb
         uvNgT9UrL+QjHo6yEd2rrTOe5AQyVK5CSEh+N22mZl6MSbgY5tUxxCebA8k17kkFjuE0
         6D/Q==
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:cc:message-id:in-reply-to
         :references:subject:mime-version:x-original-sender:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe:content-type;
        bh=BpmqwM2OynsnTr1usKUOHEcmY1CX0UDNx2rOU/VD14Q=;
        b=WetGsigtoXzfP4m8tGaaTy4CSoKte2Ohqs1Z9tAN62Nem+VdbAWOyTIJGeblEAdy8K
         Q0RWyR+x2MDVCX9dVMEEDF5vedGTCN7N/4/0rHhxVCp9IUetj2jF8rvFiK8bFV0Y5qpp
         Z0iEKjhlrBrFmjOR4faMJMqxwaRmdY/Mon7leHRnDZCLo1JuIhFhZWK0yh0SypmhJzhZ
         PdY80AeJMh6fLji3+p4aJzsmbonN9tQvgrlf9gjznx/cpIwfZ+0JwH8SyEgNUMyFrCQY
         /KL/2n0u5/u4doQPAzHZnnGRVBeqZtoZBX6vBP0m2XPvjGofkCpE0MazBr1SIT1C+zc3
         c80w==
X-Gm-Message-State: ALoCoQnlbYypDcu0JcfERJYKNYv5RNqMm64k33+oagtTko9qql4Gybw6SraRBkaKmJZwOcuTNvPs
X-Received: by 10.66.150.106 with SMTP id uh10mr2894786pab.13.1389125134910;
        Tue, 07 Jan 2014 12:05:34 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.49.97.201 with SMTP id ec9ls277653qeb.60.gmail; Tue, 07 Jan
 2014 12:05:34 -0800 (PST)
X-Received: by 10.49.48.105 with SMTP id k9mr1505027qen.1.1389125133931;
        Tue, 07 Jan 2014 12:05:33 -0800 (PST)
In-Reply-To: <35db0731-9ff9-4e8a-ae2e-29e4974b46d8@isocpp.org>
X-Original-Sender: inkwizytoryankes@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: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:8430
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/8430>

------=_Part_10518_33012136.1389125133065
Content-Type: text/plain; charset=ISO-8859-1

How it would help? `template <class...> class Template` still cant accept `
std::array<class,int>`.

On Tuesday, January 7, 2014 7:55:40 AM UTC+1, hun.nem...@gmail.com wrote:
>
> I think compile time reflection can handle this case.
> Based on this paper (
> https://github.com/hun-nemethpeter/cpp-reflector-mini/blob/master/Proposal.md
> ),
> the result will be similar to this:
>
>
> // driver
> struct SpecializationDriver
> {
>     constexpr SpecializationDriver(const meta::template_template_decl&templateTemplateDecl
> , 
>                                    const meta::template_decl& templateDecl
> )
>       : result(templateTemplateDecl.getName() == templateDecl.getName()) { 
> }
>     constexpr bool result;
> };
>
> template<template <class...> class Template, class T> $use(
> SpecializationDriver driver)
> bool is_specialization_of()
> {
>    return driver.result;
> }
>
> int main()
> {
>     std::cout<< is_specialization_of<std::tuple,  std::tuple<double>>() 
> <<::std::endl;
>     std::cout<< is_specialization_of<std::vector, std::tuple<double>>() 
> <<::std::endl;
>     std::cout<< is_specialization_of<std::array,  std::tuple<double>>() 
> <<::std::endl;
>     return 0;
> }
>
>
> Peter
>
>
>

-- 

--- 
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_10518_33012136.1389125133065
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">How it would help? `template &lt;class...&gt; class Templa=
te` still cant accept `<code><span style=3D"color:#000">std</span><span sty=
le=3D"color:#660">::</span><span style=3D"color:#000">arra<wbr>y</span><spa=
n style=3D"color:#660"></span></code>&lt;class,int&gt;`.<br><br>On Tuesday,=
 January 7, 2014 7:55:40 AM UTC+1, hun.nem...@gmail.com wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px=
 #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">I think compile time refle=
ction can handle this case.<br>Based on this paper (<a href=3D"https://gith=
ub.com/hun-nemethpeter/cpp-reflector-mini/blob/master/Proposal.md" target=
=3D"_blank" onmousedown=3D"this.href=3D'https://www.google.com/url?q\75http=
s%3A%2F%2Fgithub.com%2Fhun-nemethpeter%2Fcpp-reflector-mini%2Fblob%2Fmaster=
%2FProposal.md\46sa\75D\46sntz\0751\46usg\75AFQjCNFS9ji6XtoUPTCic92mCjgbLYX=
nnQ';return true;" onclick=3D"this.href=3D'https://www.google.com/url?q\75h=
ttps%3A%2F%2Fgithub.com%2Fhun-nemethpeter%2Fcpp-reflector-mini%2Fblob%2Fmas=
ter%2FProposal.md\46sa\75D\46sntz\0751\46usg\75AFQjCNFS9ji6XtoUPTCic92mCjgb=
LYXnnQ';return true;">https://github.com/hun-<wbr>nemethpeter/cpp-reflector=
-<wbr>mini/blob/master/Proposal.md</a>),<br>the result will be similar to t=
his:<br><br><br><div style=3D"background-color:rgb(250,250,250);border-colo=
r:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word=
"><code><div><span style=3D"color:#800">// driver</span><span style=3D"colo=
r:#000"><br></span><span style=3D"color:#008">struct</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#606">SpecializationDriver</span><s=
pan style=3D"color:#000"><br></span><span style=3D"color:#660">{</span><spa=
n style=3D"color:#000"><br>&nbsp; &nbsp; </span><span style=3D"color:#008">=
constexpr</span><span style=3D"color:#000"> </span><span style=3D"color:#60=
6">SpecializationDriver</span><span style=3D"color:#660">(</span><span styl=
e=3D"color:#008">const</span><span style=3D"color:#000"> meta</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">template_template_d=
ecl</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#000"=
> templateTemplateDecl</span><span style=3D"color:#660">,</span><span style=
=3D"color:#000"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</sp=
an><span style=3D"color:#008">const</span><span style=3D"color:#000"> meta<=
/span><span style=3D"color:#660">::</span><span style=3D"color:#000">templa=
te_decl</span><span style=3D"color:#660">&amp;</span><span style=3D"color:#=
000"> templateDecl</span><span style=3D"color:#660">)</span><span style=3D"=
color:#000"><br>&nbsp; &nbsp; &nbsp; </span><span style=3D"color:#660">:</s=
pan><span style=3D"color:#000"> result</span><span style=3D"color:#660">(</=
span><span style=3D"color:#000">templateTemplateDecl</span><span style=3D"c=
olor:#660">.</span><span style=3D"color:#000">ge<wbr>tName</span><span styl=
e=3D"color:#660">()</span><span style=3D"color:#000"> </span><span style=3D=
"color:#660">=3D=3D</span><span style=3D"color:#000"> templateDecl</span><s=
pan style=3D"color:#660">.</span><span style=3D"color:#000">getName</span><=
span style=3D"color:#660">())</span><span style=3D"color:#000"> </span><spa=
n style=3D"color:#660">{</span><span style=3D"color:#000"> </span><span sty=
le=3D"color:#660">}</span><span style=3D"color:#000"><br>&nbsp; &nbsp; </sp=
an><span style=3D"color:#008">constexpr</span><span style=3D"color:#000"> <=
/span><span style=3D"color:#008">bool</span><span style=3D"color:#000"> res=
ult</span><span style=3D"color:#660">;</span><span style=3D"color:#000"><br=
></span><span style=3D"color:#660">};</span><span style=3D"color:#000"><br>=
<br></span><span style=3D"color:#008">template</span><span style=3D"color:#=
660">&lt;</span><span style=3D"color:#008">template</span><span style=3D"co=
lor:#000"> </span><span style=3D"color:#660">&lt;</span><span style=3D"colo=
r:#008">class</span><span style=3D"color:#660">...&gt;</span><span style=3D=
"color:#000"> </span><span style=3D"color:#008">class</span><span style=3D"=
color:#000"> </span><span style=3D"color:#606">Template</span><span style=
=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">class</span><span style=3D"color:#000"> T</span><span style=3D"c=
olor:#660">&gt;</span><span style=3D"color:#000"> $use</span><span style=3D=
"color:#660">(</span><span style=3D"color:#606">SpecializationDriver</span>=
<span style=3D"color:#000"> driver</span><span style=3D"color:#660">)</span=
><span style=3D"color:#000"><br></span><span style=3D"color:#008">bool</spa=
n><span style=3D"color:#000"> is_specialization_of</span><span style=3D"col=
or:#660">()</span><span style=3D"color:#000"><br></span><span style=3D"colo=
r:#660">{</span><span style=3D"color:#000"><br>&nbsp; &nbsp;</span><span st=
yle=3D"color:#008">return</span><span style=3D"color:#000"> driver</span><s=
pan style=3D"color:#660">.</span><span style=3D"color:#000">result</span><s=
pan style=3D"color:#660">;</span><span style=3D"color:#000"><br></span><spa=
n style=3D"color:#660">}</span><span style=3D"color:#000"><br></span><span =
style=3D"color:#000"><br></span><span style=3D"color:#008">int</span><span =
style=3D"color:#000"> main</span><span style=3D"color:#660">()</span><span =
style=3D"color:#000"><br></span><span style=3D"color:#660">{</span><span st=
yle=3D"color:#000"><br>&nbsp; &nbsp; std</span><span style=3D"color:#660">:=
:</span><span style=3D"color:#000">cout</span><span style=3D"color:#660">&l=
t;&lt;</span><span style=3D"color:#000"> is_specialization_of</span><span s=
tyle=3D"color:#660">&lt;</span><span style=3D"color:#000">std</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">tupl<wbr>e</span><s=
pan style=3D"color:#660">,</span><span style=3D"color:#000"> &nbsp;std</spa=
n><span style=3D"color:#660">::</span><span style=3D"color:#000">tuple</spa=
n><span style=3D"color:#080">&lt;double&gt;</span><span style=3D"color:#660=
">&gt;()</span><span style=3D"color:#000"> </span><span style=3D"color:#660=
">&lt;&lt;::</span><span style=3D"color:#000">std</span><span style=3D"colo=
r:#660">::</span><span style=3D"color:#000">endl</span><span style=3D"color=
:#660">;</span><span style=3D"color:#000"><br>&nbsp; &nbsp; std</span><span=
 style=3D"color:#660">::</span><span style=3D"color:#000">cout</span><span =
style=3D"color:#660">&lt;&lt;</span><span style=3D"color:#000"> is_speciali=
zation_of</span><span style=3D"color:#660">&lt;</span><span style=3D"color:=
#000">std</span><span style=3D"color:#660">::</span><span style=3D"color:#0=
00">vect<wbr>or</span><span style=3D"color:#660">,</span><span style=3D"col=
or:#000"> std</span><span style=3D"color:#660">::</span><span style=3D"colo=
r:#000">tuple</span><span style=3D"color:#080">&lt;double&gt;</span><span s=
tyle=3D"color:#660">&gt;()</span><span style=3D"color:#000"> </span><span s=
tyle=3D"color:#660">&lt;&lt;::</span><span style=3D"color:#000">std</span><=
span style=3D"color:#660">::</span><span style=3D"color:#000">endl</span><s=
pan style=3D"color:#660">;</span><span style=3D"color:#000"><br>&nbsp; &nbs=
p; std</span><span style=3D"color:#660">::</span><span style=3D"color:#000"=
>cout</span><span style=3D"color:#660">&lt;&lt;</span><span style=3D"color:=
#000"> is_specialization_of</span><span style=3D"color:#660">&lt;</span><sp=
an style=3D"color:#000">std</span><span style=3D"color:#660">::</span><span=
 style=3D"color:#000">arra<wbr>y</span><span style=3D"color:#660">,</span><=
span style=3D"color:#000"> &nbsp;std</span><span style=3D"color:#660">::</s=
pan><span style=3D"color:#000">tuple</span><span style=3D"color:#080">&lt;d=
ouble&gt;</span><span style=3D"color:#660">&gt;()</span><span style=3D"colo=
r:#000"> </span><span style=3D"color:#660">&lt;&lt;::</span><span style=3D"=
color:#000">std</span><span style=3D"color:#660">::</span><span style=3D"co=
lor:#000">endl</span><span style=3D"color:#660">;</span><span style=3D"colo=
r:#000"><br>&nbsp; &nbsp; </span><span style=3D"color:#008">return</span><s=
pan style=3D"color:#000"> </span><span style=3D"color:#066">0</span><span s=
tyle=3D"color:#660">;</span><span style=3D"color:#000"><br></span><span sty=
le=3D"color:#660">}</span></div></code></div><br><br>Peter<br><br><div dir=
=3D"ltr"><br></div></div></blockquote></div>

<p></p>

-- <br />
&nbsp;<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 std-proposals+unsubscribe@isocpp.org.<br />
To post to this group, send email to std-proposals@isocpp.org.<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_10518_33012136.1389125133065--

.
