220 39124 <c9064c15-1ebb-4f2f-a32c-bedef354e29d@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: mihailnajdenov@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Concept-defined placeholder type
Date: Thu, 12 Jul 2018 14:06:06 -0700 (PDT)
Lines: 170
Approved: news@gmane.org
Message-ID: <c9064c15-1ebb-4f2f-a32c-bedef354e29d@isocpp.org>
References: <wKt6BIikQ9kr3u_mQ2oR1vvx8Uj7JLabshrk6DkzkFXpExhOUcFUc_LbGjzKQ9Z_nsrjEQrvTE5d7-8FgpX_Q-dyOVcAUaiZdsCZZsX0ctQ=@miator.net>
 <f4f2a1ca-63c1-4e33-8c0c-cf1ae244a3b5@isocpp.org>
 <lncm-v8bR9K6sqXzAewvVZNg2wuf0txaLwMD-TpIqbIGq7zL25pGi5DsziWZ92BFQ1HfQftRe9FGbSENOBMkWrzjPjrR2uKsayJJRFA4AQI=@miator.net>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_47366_1240650065.1531429566475"
X-Trace: blaine.gmane.org 1531429442 14975 195.159.176.226 (12 Jul 2018 21:04:02 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 12 Jul 2018 21:04:02 +0000 (UTC)
Cc: mihailnajdenov@gmail.com, zy@miator.net
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCUJ3A7GRAPRBP4FT7NAKGQEM644RQQ@isocpp.org Thu Jul 12 23:03:57 2018
Return-path: <std-proposals+bncBCUJ3A7GRAPRBP4FT7NAKGQEM644RQQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yw0-f198.google.com ([209.85.161.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCUJ3A7GRAPRBP4FT7NAKGQEM644RQQ@isocpp.org>)
	id 1fdikn-0003mT-CV
	for gclcip-std-proposals@m.gmane.org; Thu, 12 Jul 2018 23:03:57 +0200
Original-Received: by mail-yw0-f198.google.com with SMTP id r144-v6sf18857612ywg.9
        for <gclcip-std-proposals@m.gmane.org>; Thu, 12 Jul 2018 14:06:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        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;
        bh=rHrBH1LvdyedQngGEVVE3cqCH9i+F2ERV8Xk1+IqYRk=;
        b=wVoPvnqjRbmxRlB8+CBSc2K/EMw8Abyo64L2t1h5r/qpiCENAg8UUHxjNf6eVALXc6
         76TP+BjnqEEJU06KtgrptEdhUBnTSNc2KJIGBtYzbWSG49n9BGztHPs+MZ4is7Jfg7ej
         sJbiQ58G2crIi7eF0B9JQ+kQgjYp9Sgngg4NCLt4kXy29+k/Z/hS1hObWC6OMY/9Q1XJ
         aHoZbcP9V9IazpxLjXJFsohRz3g4IL42rhlWHyWrlv61aKodFjxYxnrvlc/SsWYQsMzO
         rCH5PUfNkGF44VxDIlBj4kIHwm83qPhAvJ98R3OQ6l5+ai9SxEmF08OsweK6cl6ICG/B
         o6uw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        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;
        bh=rHrBH1LvdyedQngGEVVE3cqCH9i+F2ERV8Xk1+IqYRk=;
        b=Spz5Y5scj8oCoYueokcoBbEgBLk0/cG4YFmjft0pLbt3uR3SIDvU9v2ikHaoHva1qO
         LSEZ1/ZWlymq6tccFmKRLH1Ez07v2/jQbixU6c+2iHxwQ94AfeTOK8O+BINwNe7xWl8V
         94K9Kx9a3uI/PMnBGFb5HmE4QTr0oZQj70JWRA8IVzcUG60DapQvG5lDfmjuOYDrhO+a
         s0JcO8d/Mm+A98Y/QQqKI4TqSPKWG9JmC7olnAY9INOvffb1T28wajrGkXBOz5IGnmTq
         bAfzVjt2ZYeQS2EIg42wcdkfKNIZZ8RO8/W185Np4IFaOwkdzXuWkbLaa4VSkrZQxZtj
         WyuQ==
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:cc:message-id:in-reply-to
         :references: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=rHrBH1LvdyedQngGEVVE3cqCH9i+F2ERV8Xk1+IqYRk=;
        b=KlKcyGuOmIRngb1ZtWPwy86U8ea767bylRl6jNEOdiYwakTNvKdKDwnRf7ndQ46mXx
         AoO94QcaOp9l4s5o1uRndi0W0KlF0w+tFN2tiSr0E7BYd7CSlkbf0z00+BmxFYDUiwYG
         NfVEC7DJ8U3Fyoj2H/DAs9lNnfAnfp1YoJSY5RibAIp71rQ/5UbYviwK8+AqyiJneNvE
         rEZh4sOL6T2F5g1HBmIMhKLufyjKOQtPebBqJoyNuvl/At5BQ5xgdky0YfoyBhRi2BG3
         qGODu7bgZrqKNAbj6FZbLbSrWzd8VKC9bBa6r2GR5pAJjhqXUP5SXRomXPicOyW6uae3
         1Q5g==
X-Gm-Message-State: AOUpUlHWiI8MYTZ21wish+uqmxy9otSvowlWmkEkOZa+S/7W33rmqQfZ
	aS806PaO1YDlZ0IM8dEBaYkUwA==
X-Google-Smtp-Source: AAOMgpeU7gVrxV4h/Lh/cjELA3iyg00Y5xhyDlWml4jMJlAzeH9iiOz9NhRELnP8wsOxRZK2gt1iDQ==
X-Received: by 2002:a25:1e87:: with SMTP id e129-v6mr1169517ybe.48.1531429568097;
        Thu, 12 Jul 2018 14:06:08 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a0d:eb05:: with SMTP id u5-v6ls31301ywe.35.gmail; Thu, 12
 Jul 2018 14:06:07 -0700 (PDT)
X-Received: by 2002:a81:78c6:: with SMTP id t189-v6mr375694ywc.7.1531429566987;
        Thu, 12 Jul 2018 14:06:06 -0700 (PDT)
In-Reply-To: <lncm-v8bR9K6sqXzAewvVZNg2wuf0txaLwMD-TpIqbIGq7zL25pGi5DsziWZ92BFQ1HfQftRe9FGbSENOBMkWrzjPjrR2uKsayJJRFA4AQI=@miator.net>
X-Original-Sender: MihailNajdenov@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:39124
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/39124>

------=_Part_47366_1240650065.1531429566475
Content-Type: multipart/alternative; 
	boundary="----=_Part_47367_1716113250.1531429566476"

------=_Part_47367_1716113250.1531429566476
Content-Type: text/plain; charset="UTF-8"



On Thursday, July 12, 2018 at 11:20:24 PM UTC+3, Zhihao Yuan wrote:
>
> From: mihailn...@gmail.com <javascript:> <mihailn...@gmail.com 
> <javascript:>> 
> Sent: Thursday, July 12, 2018 4:58 AM 
> > With types 
> > 
> > template<. . .> 
> > auto func() 
> > { 
> >   Concept Type; 
> > 
> >   if constexpr(something) 
> >     Type var = . . .; 
> >   else 
> >     Type var = . . .; 
> > 
> >   // use Type; 
> > } 
> > 
> > But this works even if Concept Type is introduced in scope (other means 
> included)! 
> > if constexpr - will physically remove the scopes altogether. And if it 
> is not a constexpr if, then we could init it outside of scope by other 
> means 
>
>  

> It doesn't, "var" cannot be looked up at the "// use Type" 
> location, so you cannot even use decltype(var) there. 
>

So, the scope remains? Makes sense actually. Well, we have a use case I 
guess :) 
 

>
> > namespace n { 
> > 
> > StandardLayoutType T; //< allowed? 
> > 
> > template <typename Producer> 
> > void uploadToGPU(Producer& producer) 
> > { 
> >   T item = producer.next(); 
> > } 
>
> That's the kind of bug that I'm looking for... 
> It shouldn't be allowed. 
>

Any reason why? Except confusion and probably impl difficulties.
 
 

>
> -- 
> Zhihao Yuan, ID lichray 
> The best way to predict the future is to invent it. 
> _______________________________________________ 
>   
>
>
>

-- 
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/c9064c15-1ebb-4f2f-a32c-bedef354e29d%40isocpp.org.

------=_Part_47367_1716113250.1531429566476
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><br><br>On Thursday, July 12, 2018 at 11:20:24 PM UTC+3, Z=
hihao Yuan wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">From: <a onmo=
usedown=3D"this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.=
href=3D&#39;javascript:&#39;;return true;" href=3D"javascript:" target=3D"_=
blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"CH1xPiUcCQAJ">mihailn...@g=
mail.com</a> &lt;<a onmousedown=3D"this.href=3D&#39;javascript:&#39;;return=
 true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true;" href=3D"=
javascript:" target=3D"_blank" rel=3D"nofollow" gdf-obfuscated-mailto=3D"CH=
1xPiUcCQAJ">mihailn...@gmail.com</a>&gt;=20
<br>Sent: Thursday, July 12, 2018 4:58 AM
<br>&gt; With types
<br>&gt;=20
<br>&gt; template&lt;. . .&gt;
<br>&gt; auto func()
<br>&gt; {=20
<br>&gt; =C2=A0 Concept Type;
<br>&gt;=20
<br>&gt; =C2=A0 if constexpr(something)
<br>&gt; =C2=A0 =C2=A0 Type var =3D . . .;
<br>&gt; =C2=A0 else
<br>&gt; =C2=A0 =C2=A0 Type var =3D . . .;
<br>&gt;=20
<br>&gt; =C2=A0 // use Type;
<br>&gt; }
<br>&gt;=20
<br>&gt; But this works even if Concept Type is introduced in scope (other =
means included)!=20
<br>&gt; if constexpr - will physically remove the scopes altogether. And i=
f it is not a constexpr if, then we could init it outside of scope by other=
 means
<br>
<br></blockquote><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;">It doesn&#39;t, &quot;var&quot; cannot be looked up at the &quot;// u=
se Type&quot;
<br>location, so you cannot even use decltype(var) there.
<br></blockquote><div><br></div><div>So, the scope remains? Makes sense act=
ually. Well, we have a use case I guess :)=C2=A0</div><div>=C2=A0</div><blo=
ckquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-=
left: 1px #ccc solid;padding-left: 1ex;">
<br>&gt; namespace n {
<br>&gt;=20
<br>&gt; StandardLayoutType T; //&lt; allowed?
<br>&gt;=20
<br>&gt; template &lt;typename Producer&gt;
<br>&gt; void uploadToGPU(Producer&amp; producer)
<br>&gt; {
<br>&gt; =C2=A0 T item =3D producer.next();
<br>&gt; }
<br>
<br>That&#39;s the kind of bug that I&#39;m looking for...
<br>It shouldn&#39;t be allowed.
<br></blockquote><div><br></div><div>Any reason why? Except confusion and p=
robably impl difficulties.</div><div>=C2=A0</div><div>=C2=A0</div><blockquo=
te class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left:=
 1px #ccc solid;padding-left: 1ex;">
<br>--
<br>Zhihao Yuan, ID lichray
<br>The best way to predict the future is to invent it.
<br>______________________________<wbr>_________________
<br>=C2=A0
<br>
<br>
<br></blockquote></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/c9064c15-1ebb-4f2f-a32c-bedef354e29d%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/c9064c15-1ebb-4f2f-a32c-bedef354e29d=
%40isocpp.org</a>.<br />

------=_Part_47367_1716113250.1531429566476--

------=_Part_47366_1240650065.1531429566475--

.
