220 32343 <9ef42c60-5709-4472-97f0-e68fb9960840@isocpp.org> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Barry Revzin <barry.revzin@gmail.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: =?UTF-8?B?UmU6IFtzdGQtcHJvcG9zYWxzXSBSZTogQWRkaW5nIHRoZSBLZXl3b3JkIOKAnGludGVyZg==?=
	=?UTF-8?B?YWNl4oCdIGluIEMrKw==?=
Date: Mon, 8 May 2017 14:27:33 -0700 (PDT)
Lines: 113
Approved: news@gmane.org
Message-ID: <9ef42c60-5709-4472-97f0-e68fb9960840@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>
 <6bfa8a30-a2c4-46d5-8ac2-c0353408a041@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_461_1955525736.1494278854028"
X-Trace: blaine.gmane.org 1494278854 28730 195.159.176.226 (8 May 2017 21:27:34 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Mon, 8 May 2017 21:27:34 +0000 (UTC)
To: ISO C++ Standard - Future Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBCJJTG7CS4ARBRWFYPEAKGQEV4VD2UQ@isocpp.org Mon May 08 23:27:30 2017
Return-path: <std-proposals+bncBCJJTG7CS4ARBRWFYPEAKGQEV4VD2UQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-yb0-f198.google.com ([209.85.213.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCJJTG7CS4ARBRWFYPEAKGQEV4VD2UQ@isocpp.org>)
	id 1d7qBm-0007OX-9B
	for gclcip-std-proposals@m.gmane.org; Mon, 08 May 2017 23:27:30 +0200
Original-Received: by mail-yb0-f198.google.com with SMTP id v131sf50578960ybb.5
        for <gclcip-std-proposals@m.gmane.org>; Mon, 08 May 2017 14:27:36 -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=3ApNQoTV/cyRUIDEqim8Y6wUo31Ql1Kh0sjDEI0BAk0=;
        b=f0Ds2rcrp5eNPBrKStgsljepw4JGCcLsiXijg2NddttpWwfKATkE1oo18+w3axR9Uf
         k8m06m/srNl4qSD4mNZq49EXUQgRlA6Kvy7Y/PfqVOfjDtIBi4kqhwnHRT5sZrg3nh0u
         WZNRijNFUhDPaFXrVwQagpEvWfGie5msO5I9ypEouZ6aALNRoUTULUDGWwQnv6vMoy/r
         KWWJeynreuwcvvP1O257e/2+k571JKQkV3GZTSjkwiK14DAeCEeqxGuHcH4qNjAhYLkH
         /PrVroQTy6noNGNlg4RCjSDkxfUfcH6NnrLDmKCHFkvEBwRj/b1W4rxfKogP4MlllKod
         5hBA==
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=3ApNQoTV/cyRUIDEqim8Y6wUo31Ql1Kh0sjDEI0BAk0=;
        b=cMhvrBm0xAHrNcCAN5gP8lbPNaPIiF5Cg0BGMxJVCA16b2wYXKYrWTQuhuOboGjpYk
         6OJNhwJ0dwicfLasyGfQ3HICHEpzqGhbKWIgOacVi8vPCc+sfLgGTfpR8GZWVIImBrfg
         fer8J8ktcXJcGOfRQ+R2EqfejUbqX59t9OT+X8NwWQdF68eM5sQ9LuiX+YB2GX93lo4Q
         mL/m5pBXKFTsG93+mCpZIMShivuEb0A3iP+6LoNl8zj/u6Zy9j5V2I/fn1MBFhPC/1xg
         c/X4/R0pJ4LWgIUV/XBsrP1FsyLQaUGAPUo9qmLHXMZ+zy0t89Hz2WNpy4JCsJ/Q6BY+
         5j4Q==
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=3ApNQoTV/cyRUIDEqim8Y6wUo31Ql1Kh0sjDEI0BAk0=;
        b=cO0ogcuOP/u626JfdoK1ur8gaqi1BTYmbzCbU4JrfcAC3jPnvl9QrKEsXxyfUfgS+I
         8jIB2e7qxmAUaHX9omS7Ks/iEAYnQpL7f4A2m01Zcbf06bnCmFomDmfch3rRXgS4Zr+B
         gkJNJgWLk7+fgX9Kjc3xa7IWKWUSYihGDz3VXk9bH7VbAOVojn3fPgEURaCl4zFY1r+W
         FCZeCsaBwRMMPYzFRFPXoBFb/XI+4vRcK2l8JOqQ6HMGnmcuNz5AyqVNYxC5hZ8/WGwf
         ew+TVn7PV5K3AJY61EXQnvJWoKJXIZSsHKEQ1yB2Qjms3gjHOT+GuK7d2d8ob8kAXw5c
         IJdQ==
X-Gm-Message-State: AN3rC/6HW2XDXWXaHLruz49ol1NDSHwuEcPASVuJWS3qvaCdewZmsW8k
	D6/MzGD0bM5J/A==
X-Received: by 10.129.57.134 with SMTP id g128mr14379440ywa.77.1494278855611;
        Mon, 08 May 2017 14:27:35 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.157.40.137 with SMTP id s9ls9753807ota.44.gmail; Mon, 08 May
 2017 14:27:34 -0700 (PDT)
X-Received: by 10.157.14.147 with SMTP id 19mr1301189otj.1.1494278854561;
        Mon, 08 May 2017 14:27:34 -0700 (PDT)
In-Reply-To: <6bfa8a30-a2c4-46d5-8ac2-c0353408a041@isocpp.org>
X-Original-Sender: Barry.Revzin@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:32343
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/32343>

------=_Part_461_1955525736.1494278854028
Content-Type: multipart/alternative; 
	boundary="----=_Part_462_819523458.1494278854028"

------=_Part_462_819523458.1494278854028
Content-Type: text/plain; charset=UTF-8


>
> Yep, I think we are talking about automatic type-erasure here.
>>
>> Sean Parent has done a lot of work with type-erasure and polymorphic 
>> values types based on "concepts" (pre Concepts concepts).
>>
>> I wonder if Concepts + reflection might allow someone to write:
>>
>> Foo foo; // foo happens to model Concept
>> std::erased<Concept> efoo = foo;
>> func(efoo);  // Not a templatized function
>>
>> Tony
>>
>
> That would require lots of things that don't exist at present:
>
> 1: Reflection to be able to introspect concepts, being able to iterate 
> over their constituent expressions.
>
> 2: Reflection would need to be able to *generate* code. Otherwise, 
> `std::erased` wouldn't be able to generate non-member functions to handle 
> non-members of the `Concept`.
>
> 3: Concepts would have to be able to be passed as template parameters.
>

Yeah, but I'd argue it's really what you want. Type erasure is extremely 
useful, Concepts already express the desired interface, so it's really 
natural to stick them together. It'd be pretty valuable to either:

(1) be able to write a library that works like erased<Concept> (e.g. Rust's 
Box)
(2) provide a mechanism in the language to implicitly generate such a 
thing, whether by
(2a) reappropriating the abbreviated function syntax to do type erasure 
instead, or 
(2b) providing a new syntax like void foo(Concept^ ) 

Any of those approaches requires a lot of stuff that we don't have today, 
and won't have on day 1 on any of these TSes hitting, but I think are worth 
considering longer term as next steps for cool problems to solve with 
Concepts.

-- 
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/9ef42c60-5709-4472-97f0-e68fb9960840%40isocpp.org.

------=_Part_462_819523458.1494278854028
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;bor=
der-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><div dir=3D"ltr"><div><div class=3D"gmail_quote"=
><div>Yep, I think we are talking about automatic type-erasure here.<br></d=
iv><div><br></div><div>Sean Parent has done a lot of work with type-erasure=
 and polymorphic values types based on &quot;concepts&quot; (pre Concepts c=
oncepts).<br><br></div><div>I wonder if Concepts + reflection might allow s=
omeone to write:<br><br></div><div>Foo foo; // foo happens to model Concept=
<br></div><div>std::erased&lt;Concept&gt; efoo =3D foo;<br></div><div>func(=
efoo);=C2=A0 // Not a templatized function<br></div><div><br></div><div>Ton=
y<br></div></div></div></div></blockquote><div><br>That would require lots =
of things that don&#39;t exist at present:<br><br>1: Reflection to be able =
to introspect concepts, being able to iterate over their constituent expres=
sions.<br><br>2: Reflection would need to be able to <i>generate</i> code. =
Otherwise, `std::erased` wouldn&#39;t be able to generate non-member functi=
ons to handle non-members of the `Concept`.<br><br>3: Concepts would have t=
o be able to be passed as template parameters.<br></div></div></blockquote>=
<div><br></div><div>Yeah, but I&#39;d argue it&#39;s really what you want. =
Type erasure is extremely useful, Concepts already express the desired inte=
rface, so it&#39;s really natural to stick them together. It&#39;d be prett=
y valuable to either:</div><div><br></div><div>(1) be able to write a libra=
ry that works like erased&lt;Concept&gt; (e.g. Rust&#39;s Box)</div><div>(2=
) provide a mechanism in the language to implicitly generate such a thing, =
whether by</div><div>(2a) reappropriating the abbreviated function syntax t=
o do type erasure instead, or=C2=A0</div><div>(2b) providing a new syntax l=
ike void foo(Concept^ )=C2=A0</div><div><br></div><div>Any of those approac=
hes requires a lot of stuff that we don&#39;t have today, and won&#39;t hav=
e on day 1 on any of these TSes hitting, but I think are worth considering =
longer term as next steps for cool problems to solve with Concepts.</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/9ef42c60-5709-4472-97f0-e68fb9960840%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9ef42c60-5709-4472-97f0-e68fb9960840=
%40isocpp.org</a>.<br />

------=_Part_462_819523458.1494278854028--

------=_Part_461_1955525736.1494278854028--

.
