220 32356 <09ec869a-2c1d-4fe8-8295-253e5001edd4@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Nicol Bolas <jmckesson@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: =?UTF-8?B?UmU6IFtzdGQtcHJvcG9zYWxzXSBSZTogQWRkaW5nIHRoZSBLZXl3b3JkIOKAnGludGVyZg==?=
	=?UTF-8?B?YWNl4oCdIGluIEMrKw==?=
Date: Tue, 9 May 2017 07:39:08 -0700 (PDT)
Lines: 184
Approved: news@gmane.org
Message-ID: <09ec869a-2c1d-4fe8-8295-253e5001edd4@isocpp.org>
References: <c8742174-fef0-44a9-988d-2c8aebba9243@isocpp.org>
 <CACL3gUXPSVdsT0Z77igxGVtHU9ALGPcN=7hwKKKfBmt8eQmXtA@mail.gmail.com>
 <9ee212eb-4037-40c4-94c3-57a9a170a4c3@isocpp.org> <1765502.4y06pMOS3s@tjmaciei-mobl1>
 <e8fb03f4-8c94-46c2-a612-acab81117998@isocpp.org>
 <CAOHCbiswurpbE6tG3igWTsFfpJ=LAeT9PoTUZBNsrnMOhEwSxQ@mail.gmail.com>
 <45a81e95-d352-49ab-9c6e-7375aa41413c@isocpp.org>
 <d832c461-fa3e-429e-a36b-1d0b11eb634f@isocpp.org>
 <da34864f-4752-4969-bac5-96c6ce133bd1@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_3151_357011682.1494340748237"
X-Trace: blaine.gmane.org 1494340749 27774 195.159.176.226 (9 May 2017 14:39:09 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Tue, 9 May 2017 14:39:09 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCEKFTV6ZUMBBDFJY7EAKGQE4DQT2LA@isocpp.org Tue May 09 16:39:05 2017
Return-path: <std-proposals+bncBCEKFTV6ZUMBBDFJY7EAKGQE4DQT2LA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-pg0-f72.google.com ([74.125.83.72])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCEKFTV6ZUMBBDFJY7EAKGQE4DQT2LA@isocpp.org>)
	id 1d86I4-00076n-M2
	for gclcip-std-proposals@m.gmane.org; Tue, 09 May 2017 16:39:05 +0200
Original-Received: by mail-pg0-f72.google.com with SMTP id d127sf921696pga.11
        for <gclcip-std-proposals@m.gmane.org>; Tue, 09 May 2017 07:39:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=date:from:to: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=+bpGl6TloiaVW/iI1nt7bJuwWe+c/tMXo5SnC2MfOu0=;
        b=wbfLsKuKrlleJFkjYSyOf7k1TWjsx6qJ7V10kweBj25tYRTR/Dk7TmxH13DmTZSJ1N
         1KEZxp8M0GYVC9ElVV5MsM0GVEs/kWLsOx0GH2Ar0fskg5kbD+fA6j+tSfVmsBmVfxjU
         qhxi3RzjDrqH2urjOl12mY5k6TwuTEgewz6W+a3Atv1ExKd0gGz0lskwdzL3jI8py4GU
         jgWDawI+gz6QOdzqj13jGyIqKA4Ij/ZgV4V/ardyn+CfF21axL52k+o8z+rqYXVvrT/M
         Ly6KDLuyWQeDZsxzCUd9OPhZlKFxvX/nss7hRDVNN8IUv4ErjUcChHLwTaF/bh/28LDd
         Y+Bw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=date:from:to: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=+bpGl6TloiaVW/iI1nt7bJuwWe+c/tMXo5SnC2MfOu0=;
        b=cXB5AR+Qbfyvs7vazJjR819sD/04MqHbVZLAjHe2/SsqJ7VCF1rDoVj+AUxUb4M15t
         5aHNJWgVoj1I6hsu6Pe6OvciwVqPbpXeGydWpBfCP41IRwuC2jxATi/76TkkYOJ3u5df
         rRXf3ItsJ12G/XHMekFEXcgGo1Ei+sYPaZGYf5nhiMeyyGOWmYdoQ/m7A2d1CW/9DI2S
         +01DXJR8fL+1x1DRv9iQ+HHX3+SJJMUoDFwMDW3K2+P5RC4uPiqVavfe9DvK34gsRbAp
         nFoiedWKHd/cba2FqDVZX2jbYpUWNtBPJKynuacUmWe/wPqdDqIeK5otXAo84Io7/hNr
         5yqQ==
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: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=+bpGl6TloiaVW/iI1nt7bJuwWe+c/tMXo5SnC2MfOu0=;
        b=UMJ8m9tDn9NPOh0WXKuhmk81Yi6aQCKHkoRNbfiWp1J58cOkEfO1nGjVjCbqeb2Bzt
         C5ss7Y9bdyprfNixnao5/+Gr+jRmCmef4/VOYCHA4HQq87MkxwpAGpWniDZmAvNGJuH8
         ijcUXnR4NZ5FMB928cxaOg+DYHboafaBnjQIyo8KkuXCBGtIWUFWNAmS63cgvlJDUqSc
         3g54sYvO4MJOA/oCk8bl99Bk5zcSwBFNZgfYiSjoDfN0rSbc+y71nvedF2IDQPKnYZVv
         +tz2/R+966hsncbY3/0DCgxdMdolJa6IJxxymFJY4DbipoEazwlBq8As/tVA1ghSg42E
         C4eg==
X-Gm-Message-State: AODbwcAK6kJepTmcnuPGvjcZjGjM6WuZ3jw9ZRzRNO9cJJSE+dhFOLkk
	fU+bqPiJjWWPYg==
X-Received: by 10.99.103.198 with SMTP id b189mr104252pgc.156.1494340749611;
        Tue, 09 May 2017 07:39:09 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.5.70 with SMTP id 64ls429043otw.10.gmail; Tue, 09 May 2017
 07:39:08 -0700 (PDT)
X-Received: by 10.157.40.242 with SMTP id s105mr6083ota.5.1494340748771;
        Tue, 09 May 2017 07:39:08 -0700 (PDT)
In-Reply-To: <da34864f-4752-4969-bac5-96c6ce133bd1@isocpp.org>
X-Original-Sender: jmckesson@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: <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:32356
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32356>

------=_Part_3151_357011682.1494340748237
Content-Type: multipart/alternative; 
	boundary="----=_Part_3152_1491932021.1494340748237"

------=_Part_3152_1491932021.1494340748237
Content-Type: text/plain; charset="UTF-8"

On Tuesday, May 9, 2017 at 4:34:19 AM UTC-4, Jakob Riedle wrote:
>
> *Concerning the Answer by Nicol Bolas*
>
>> `vector<Callable<void()>>::value_type` needs to be a specific type (one 
>> that is the same in all translation units), 
>
> and it's probably best that this type have a well-defined name. And that 
>> name can't be `Callable<void()>`.
>
>
> Yes it can, let me show you why:
>

> Imagine a pure abstract base class BaseClass and a derived class 
> *DerivedClass*:
> class BaseClass{
>  public:
>   virtual void operator()() = 0; 
> };
>
> class DerivedClass : public BaseClass{
>  public:
>   void operator()() override {/*Whatever*/}
> };
> Now imagine a vector of *BaseClass *objects in which e.g. *DerivedClass *objects 
> can be inserted.
>

That would have to be a `vector<BaseClass*>`. Which would be different from 
`vector<BaseClass>`.
 

> Your argument would be, that std::vector<BaseClass>::value_type needs to 
> be a concrete type, *which it is, its BaseClass.*
>

No, my argument is that `Callable<void()>` is a *concept*. Concepts *are 
not types*; in the current TS, they are either functions or variables, 
neither of which is a *type*.

Therefore, `vector<Callable<void()>>::value_type` *cannot be* 
`Callable<void()>`.

Still that doesn't mean, It will actually be DerivedClass in all 
> translation units, but thats how this mechanism is supposed to work.
> For *Dynamic Concepts, *this is the way, Mingxing Wang proposed it: as 
> pure virtual base class.
>

In order to have "dynamic concepts", you need some construct to refer to 
such a thing, which must by necessity be *different* from how you refer to 
*static* concepts. `Callable<>` is a static concept, so if you want to make 
a dynamic concept based on it, you must use some other syntax besides 
`Callable<>`.

That's my point. You can't have `Callable<>` be both a static and dynamic 
concept. That's why its best to make "dynamic concepts" specifically be 
types.

-- 
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/09ec869a-2c1d-4fe8-8295-253e5001edd4%40isocpp.org.

------=_Part_3152_1491932021.1494340748237
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">On Tuesday, May 9, 2017 at 4:34:19 AM UTC-4, Jakob Riedle =
wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8=
ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><s=
pan style=3D"background-color:rgb(250,250,250)"><font color=3D"#000000" fac=
e=3D"arial, sans-serif"><b>Concerning the Answer by Nicol Bolas</b></font><=
/span></div><div><span style=3D"background-color:rgb(250,250,250)"><font co=
lor=3D"#000000" face=3D"arial, sans-serif"><b></b></font></span></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex"><span style=3D"background-colo=
r:rgb(250,250,250)"><span style=3D"background-color:rgb(255,255,255)">`vect=
or&lt;Callable&lt;void()&gt;&gt;::</span><span style=3D"background-color:rg=
b(255,255,255)">val<wbr>ue_type` needs to be a specific type (one that is t=
he same in all translation units),</span></span>=C2=A0</blockquote><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px=
 solid rgb(204,204,204);padding-left:1ex"><span style=3D"background-color:r=
gb(250,250,250)"><span style=3D"background-color:rgb(255,255,255)">and it&#=
39;s probably best that this type have a well-defined name. And that name c=
an&#39;t be `Callable&lt;void()&gt;`.</span></span></blockquote><div><br></=
div><div>Yes it can, let me show you why:</div></div></blockquote><div></di=
v><blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;b=
order-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div><br></=
div><div>Imagine a pure abstract base class <font style=3D"font-weight:bold=
" face=3D"courier new, monospace">BaseClass </font><font face=3D"arial, san=
s-serif">and a derived class </font><font face=3D"courier new, monospace"><=
b>DerivedClass</b></font><font style=3D"font-weight:bold" face=3D"courier n=
ew, monospace">:</font></div><div><div style=3D"font-family:&quot;courier n=
ew&quot;,monospace;font-weight:bold;background-color:rgb(250,250,250);borde=
r-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:brea=
k-word"><code><div><font color=3D"#660066"><span style=3D"color:#008">class=
</span><span style=3D"color:#000"> </span><span style=3D"color:#606">BaseCl=
ass</span><span style=3D"color:#660">{</span><span style=3D"color:#000"><br=
>=C2=A0</span><span style=3D"color:#008">public</span><span style=3D"color:=
#660">:</span><span style=3D"color:#000"><br>=C2=A0 </span><span style=3D"c=
olor:#008">virtual</span><span style=3D"color:#000"> </span><span style=3D"=
color:#008">void</span><span style=3D"color:#000"> </span><span style=3D"co=
lor:#008">operator</span><span style=3D"color:#660">()()</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">=3D</span><span style=3D=
"color:#000"> </span><span style=3D"color:#066">0</span><span style=3D"colo=
r:#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"co=
lor:#008">class</span><span style=3D"color:#000"> </span><span style=3D"col=
or:#606">DerivedClass</span><span style=3D"color:#000"> </span><span style=
=3D"color:#660">:</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#008">public</span><span style=3D"color:#000"> </span><span style=3D"c=
olor:#606">BaseClass</span><span style=3D"color:#660">{</span><span style=
=3D"color:#000"><br>=C2=A0</span><span style=3D"color:#008">public</span><s=
pan style=3D"color:#660">:</span><span style=3D"color:#000"><br>=C2=A0 </sp=
an><span style=3D"color:#008">void</span><span style=3D"color:#000"> </span=
><span style=3D"color:#008">operator</span><span style=3D"color:#660">()()<=
/span><span style=3D"color:#000"> </span><span style=3D"color:#008">overrid=
e</span><span style=3D"color:#000"> </span><span style=3D"color:#660">{</sp=
an><span style=3D"color:#800">/*Whatever*/</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></span></font></div></code></div><fo=
nt face=3D"arial, sans-serif">Now imagine a vector of </font><font face=3D"=
courier new, monospace"><b>BaseClass </b></font><font face=3D"arial, sans-s=
erif">objects in which e.g. </font><font face=3D"courier new, monospace"><b=
>DerivedClass </b></font><font face=3D"arial, sans-serif">objects can be in=
serted.</font></div></div></blockquote><div><br>That would have to be a `ve=
ctor&lt;BaseClass*&gt;`. Which would be different from `vector&lt;BaseClass=
&gt;`.<br>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin: 0;=
margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=
=3D"ltr"><div><font face=3D"arial, sans-serif"></font></div><div><font face=
=3D"arial, sans-serif">Your argument would be, that std::vector&lt;BaseClas=
s&gt;::value_<wbr>type needs to be a concrete type, </font><b><font face=3D=
"arial, sans-serif">which it is, its=C2=A0</font><font face=3D"courier new,=
 monospace">BaseClass</font><font face=3D"arial, sans-serif">.</font></b></=
div></div></blockquote><div><br>No, my argument is that `Callable&lt;void()=
&gt;` is a <i>concept</i>. Concepts <i>are not types</i>; in the current TS=
, they are either functions or variables, neither of which is a <i>type</i>=
..<br><br>Therefore, `vector&lt;Callable&lt;void()&gt;&gt;::value_type` <i>c=
annot be</i> `Callable&lt;void()&gt;`.<br><br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc soli=
d;padding-left: 1ex;"><div dir=3D"ltr"><div><font face=3D"arial, sans-serif=
">Still that doesn&#39;t mean, It will actually be DerivedClass in all tran=
slation units, but thats how this mechanism is supposed to work.</font></di=
v><div><font face=3D"arial, sans-serif">For <i>Dynamic Concepts, </i>this i=
s the way, Mingxing Wang proposed it: as pure virtual base class.</font></d=
iv></div></blockquote><div><br>In order to have &quot;dynamic concepts&quot=
;, you need some construct to refer to such a thing, which must by necessit=
y be <i>different</i> from how you refer to <i>static</i> concepts. `Callab=
le&lt;&gt;` is a static concept, so if you want to make a dynamic concept b=
ased on it, you must use some other syntax besides `Callable&lt;&gt;`.<br><=
br>That&#39;s my point. You can&#39;t have `Callable&lt;&gt;` be both a sta=
tic and dynamic concept. That&#39;s why its best to make &quot;dynamic conc=
epts&quot; specifically be types.</div></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/09ec869a-2c1d-4fe8-8295-253e5001edd4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/09ec869a-2c1d-4fe8-8295-253e5001edd4=
%40isocpp.org</a>.<br />

------=_Part_3152_1491932021.1494340748237--

------=_Part_3151_357011682.1494340748237--

.
