220 9838 <23cc4067-d6c1-4444-b7b2-d71ff1127736@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: Christ-Jan Wijtmans <cj.wijtmans@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: auto variable templates?
Date: Sun, 16 Mar 2014 04:39:47 -0700 (PDT)
Lines: 130
Approved: news@gmane.org
Message-ID: <23cc4067-d6c1-4444-b7b2-d71ff1127736@isocpp.org>
References: <ec829ec4-9d4e-4d5c-8673-a58d46fec41b@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_4390_24636596.1394969987810"
X-Trace: ger.gmane.org 1394969980 19240 80.91.229.3 (16 Mar 2014 11:39:40 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Sun, 16 Mar 2014 11:39:40 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDU4R6M73ABRBBE3S2MQKGQEHGULORI@isocpp.org Sun Mar 16 12:39:50 2014
Return-path: <std-proposals+bncBDU4R6M73ABRBBE3S2MQKGQEHGULORI@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ve0-f197.google.com ([209.85.128.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDU4R6M73ABRBBE3S2MQKGQEHGULORI@isocpp.org>)
	id 1WP9Px-0005DD-WF
	for gclcip-std-proposals@m.gmane.org; Sun, 16 Mar 2014 12:39:50 +0100
Original-Received: by mail-ve0-f197.google.com with SMTP id pa12sf10993096veb.0
        for <gclcip-std-proposals@m.gmane.org>; Sun, 16 Mar 2014 04:39:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=date:from:to: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=OWamgStlZGy+dtBqXY4itv12EAPOogFBtVfiwiMwLDA=;
        b=o5Y/2CrZZg/2AoyORdyr/k3rayI6txiYofvcYTD8RUBgnAEHKlZKQiFANvGV6kU6Jh
         417lWIEHS0scuWkxBdQfsqpn+WyX3QNPoiMnNaMApYalDHJ4o0MClTUSd32q2G7QbsLv
         AEnv2U9wTTdZRcISMnynk5FzJF2biYCasSmo6O8KysDjcGBaVCZbzaWBpR1M9jSTfoeE
         gn0zm2TWtCPWH9KNz29q4BovaVqAkRrwAiqyeufqEpdUo5vdPS/5It5BVZ3VFhmscUqO
         wWjgq4PjkvPdTFkWBOnxI7mxWGI52iQOJfpx9+8CrPNRYvBHM8kTXB8M5OBeyF+WCI7X
         LDrQ==
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: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=OWamgStlZGy+dtBqXY4itv12EAPOogFBtVfiwiMwLDA=;
        b=iEUtaIbxBJnAARBHa/rIZxdzy1+D2xuT6CHTW4uudcRwSATn9K/y1lfYFmVzJ7KPa9
         Lq1OkmQQK3r2bEz51rDkxX/ZnZTWJC4uL5QuIm3wmTLpQ00C5TmtVSqsmw8XZ7rSvW6d
         o50mm5GPUAl7EaZbR/u+PsE4GTZhwPR8KU1OrCUphGPBQ74oQlfUYyx76hVWWPk7dXdi
         sEVQrAmFGyPhUr3nwEf/Xqw45HX7T97M7jeTQJRHHwotOjY3TGyuJLoZOuUKpOuQ3DIu
         SPDTWhcl/xR/y37mar5kgp2vlwP3wbXH5rLeP613DrtF4OqNBH6my5bnGu7RGpTfdJuW
         ykKg==
X-Gm-Message-State: ALoCoQlHkOzkjsz6xnAXvYQEiOj9b7PXpBJUkeQGU1u5A2lWqz74muvPEL3KD0Fx+f5bLzhSZkQj
X-Received: by 10.236.105.170 with SMTP id k30mr5800066yhg.30.1394969988854;
        Sun, 16 Mar 2014 04:39:48 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.140.47.239 with SMTP id m102ls515277qga.8.gmail; Sun, 16 Mar
 2014 04:39:48 -0700 (PDT)
X-Received: by 10.140.107.52 with SMTP id g49mr15793qgf.9.1394969988269;
        Sun, 16 Mar 2014 04:39:48 -0700 (PDT)
In-Reply-To: <ec829ec4-9d4e-4d5c-8673-a58d46fec41b@isocpp.org>
X-Original-Sender: cj.wijtmans@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:9838
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/9838>

------=_Part_4390_24636596.1394969987810
Content-Type: text/plain; charset=UTF-8

is typedef a declaration? I remember VC++ suppporting template typedefs 
however apparently this was not standard C++.

Op zaterdag 15 maart 2014 21:46:21 UTC+1 schreef Andrew Tomazos:
>
> Is the following supposed to be ill-formed according to the current draft?
>
> template<class> constexpr auto X = 42;
> int main(){
>         static_assert(X<int> == 42, "");}
>
>
> [dcl.spec.auto]/4 says that auto is allowed when declaring variables in 
> namespace-scope, but doesn't explicitly say in variable templates - 
> consequently this is ill-formed.
>
> Clang trunk rejects it, albeit it with an obtuse error message: "invalid 
> operands to binary expression ('auto' and 'int')"
>
> Was this intended?
>
> If so, what was the problem with having them?  auto variable templates 
> would be very useful.
>
>

-- 

--- 
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_4390_24636596.1394969987810
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">is typedef a declaration? I remember VC++ suppporting temp=
late typedefs however apparently this was not standard C++.<br><br>Op zater=
dag 15 maart 2014 21:46:21 UTC+1 schreef Andrew Tomazos:<blockquote class=
=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #cc=
c solid;padding-left: 1ex;"><div dir=3D"ltr">Is the following supposed to b=
e ill-formed according to the current draft?<div><br></div><div><pre style=
=3D"margin-bottom:10px;padding:5px;font-size:14px;font-family:Consolas,Menl=
o,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream V=
era Sans Mono','Courier New',monospace,serif;overflow:auto;width:auto;max-h=
eight:600px;word-wrap:normal;color:rgb(0,0,0);line-height:17.80480003356933=
6px;background:rgb(238,238,238)"><code style=3D"font-family:Consolas,Menlo,=
Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Ver=
a Sans Mono','Courier New',monospace,serif;white-space:inherit;background-i=
mage:initial;background-repeat:initial"><span style=3D"color:rgb(0,0,139);b=
ackground:transparent">template</span><span style=3D"color:rgb(128,0,0);bac=
kground:transparent">&lt;class&gt;</span><span style=3D"background:transpar=
ent"> </span><span style=3D"color:rgb(0,0,139);background:transparent">cons=
texpr</span><span style=3D"background:transparent"> </span><span style=3D"c=
olor:rgb(0,0,139);background:transparent">auto</span><span style=3D"backgro=
und:transparent"> X </span><span style=3D"background:transparent">=3D</span=
><span style=3D"background:transparent"> </span><span style=3D"color:rgb(12=
8,0,0);background:transparent">42</span><span style=3D"background:transpare=
nt">;</span><span style=3D"background:transparent">

</span><span style=3D"color:rgb(43,145,175);background:transparent">int</sp=
an><span style=3D"background:transparent"> main</span><span style=3D"backgr=
ound:transparent">()</span><span style=3D"background:transparent">
</span><span style=3D"background:transparent">{</span><span style=3D"backgr=
ound:transparent">
        </span><span style=3D"color:rgb(0,0,139);background:transparent">st=
atic_assert</span><span style=3D"background:transparent">(</span><span styl=
e=3D"background:transparent">X</span><span style=3D"color:rgb(128,0,0);back=
ground:transparent">&lt;int&gt;</span><span style=3D"background:transparent=
"> </span><span style=3D"background:transparent">=3D=3D</span><span style=
=3D"background:transparent"> </span><span style=3D"color:rgb(128,0,0);backg=
round:transparent">42</span><span style=3D"background:transparent">,</span>=
<span style=3D"background:transparent"> </span><span style=3D"color:rgb(128=
,0,0);background:transparent">""</span><span style=3D"background:transparen=
t">);</span><span style=3D"background:transparent">
</span><span style=3D"background:transparent">}</span></code></pre></div><d=
iv><br></div><div>[dcl.spec.auto]/4 says that auto is allowed when declarin=
g variables in namespace-scope, but doesn't explicitly say in variable temp=
lates - consequently this is ill-formed.</div><div><br></div><div>Clang tru=
nk rejects it, albeit it with an obtuse error message: "<span style=3D"font=
-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sa=
ns Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;white-spa=
ce:inherit;color:rgb(0,0,0);font-size:14px;line-height:17.804800033569336px=
;background:transparent">invalid operands to binary expression </span><span=
 style=3D"font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mo=
no','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,s=
erif;white-space:inherit;color:rgb(0,0,0);font-size:14px;line-height:17.804=
800033569336px;background:transparent">(</span><span style=3D"font-family:C=
onsolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono',=
'Bitstream Vera Sans Mono','Courier New',monospace,serif;white-space:inheri=
t;font-size:14px;line-height:17.804800033569336px;color:rgb(128,0,0);backgr=
ound:transparent">'auto'</span><span style=3D"font-family:Consolas,Menlo,Mo=
naco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera =
Sans Mono','Courier New',monospace,serif;white-space:inherit;color:rgb(0,0,=
0);font-size:14px;line-height:17.804800033569336px;background:transparent">=
 and </span><span style=3D"font-family:Consolas,Menlo,Monaco,'Lucida Consol=
e','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier=
 New',monospace,serif;white-space:inherit;font-size:14px;line-height:17.804=
800033569336px;color:rgb(128,0,0);background:transparent">'int'</span><span=
 style=3D"font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mo=
no','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,s=
erif;white-space:inherit;color:rgb(0,0,0);font-size:14px;line-height:17.804=
800033569336px;background:transparent">)"</span></div><div><br></div><div>W=
as this intended?</div><div><br></div><div>If so, what was the problem with=
 having them? &nbsp;auto variable templates would be very useful.</div><div=
><br></div></div></blockquote></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_4390_24636596.1394969987810--

.
