220 10473 <c3133dc1-f4a5-4262-bd17-4aeb2a56fa06@isocpp.org> article
Path: news.gmane.org!not-for-mail
From: germandiago@gmail.com
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Researching any-like general type erasure (not a
 proposal as of now).
Date: Thu, 1 May 2014 11:09:27 -0700 (PDT)
Lines: 187
Approved: news@gmane.org
Message-ID: <c3133dc1-f4a5-4262-bd17-4aeb2a56fa06@isocpp.org>
References: <3c02d482-360c-40fc-973c-7a348566d2ff@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: multipart/alternative; 
	boundary="----=_Part_54_25944340.1398967767438"
X-Trace: ger.gmane.org 1398967777 29526 80.91.229.3 (1 May 2014 18:09:37 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 1 May 2014 18:09:37 +0000 (UTC)
Cc: germandiago@gmail.com
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDC2VXM4YYDRBWE3RKNQKGQEDSIDTGA@isocpp.org Thu May 01 20:09:31 2014
Return-path: <std-proposals+bncBDC2VXM4YYDRBWE3RKNQKGQEDSIDTGA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ie0-f197.google.com ([209.85.223.197])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBDC2VXM4YYDRBWE3RKNQKGQEDSIDTGA@isocpp.org>)
	id 1WfvQI-0006Pq-SQ
	for gclcip-std-proposals@m.gmane.org; Thu, 01 May 2014 20:09:31 +0200
Original-Received: by mail-ie0-f197.google.com with SMTP id rd18sf17987681iec.8
        for <gclcip-std-proposals@m.gmane.org>; Thu, 01 May 2014 11:09:29 -0700 (PDT)
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=TiDGUkgtAmG7CExnHAdAetjk8djt9YADB7NmOb60QPk=;
        b=xFAyoAHkhcH8/Z3r5MR217l7CuNSt/mjDJqT//B4e9snQ44szjgxlfVbniyJ8P56zw
         MGfELas9K/MeEwc8OYw1sy/P/wBtVzC6IpQlSsXFB7YufblOCwfcdkteY4b1KUaKFRaU
         bbjBWw4Tajar+5Ugxk0izAnwZqR8SrA3qkKeuyJPP9fAiu9zGPuFJPN6mv3KC3RoxvtF
         QXKEgz9OJBcLfcYrjJFy6gV1W4yrcJPIHRLiwmuxCs9xOax6IcImuTUhIIH6obBumTmP
         jwfIV/2BBw4xFhqRjDZ86xVzaRuLLCn1FPCLPsXCkf/Cb4St879roNgcLJorjt93brUo
         xSJg==
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=TiDGUkgtAmG7CExnHAdAetjk8djt9YADB7NmOb60QPk=;
        b=O2gqyq3lXwgWA1X44arCbpuYxXwQ4a+PdRaJxTO1ARdLRWObRxr6lz31rksPWc5QX3
         d84g9BipC6+tMqm+8D6p4XaOOr170oweo++n6C2wpMiB76d6fUTgj7jTNAC8W1+/L+mf
         eeCD4Qs/LRsu3N56oMVdca7CTigIBq8wh1q64LvbzgAsSchuqO/mhzaB0PFbz9iqFc5v
         bOdFLwANoiMoW0snB64qoVaQ1h1EeSBQoHoJT8pECfjK4nxOc/8vLYEHRWO7r3dDi4kt
         TMK+qOP0U9y6hFjsy2GrJiBwcuHlqK/xkW4UvbvPbjksQigPfLrtVyhou40u/IvWmebc
         k0aw==
X-Gm-Message-State: ALoCoQm3X73Ke/5cDfY7JAcOSFzfgOdK6uTe+PDKgwB/pbMy5vP3kYfqwIQUHLGERj1PjFirlSV8
X-Received: by 10.50.33.101 with SMTP id q5mr1992585igi.3.1398967769663;
        Thu, 01 May 2014 11:09:29 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.182.66.8 with SMTP id b8ls613420obt.73.gmail; Thu, 01 May 2014
 11:09:28 -0700 (PDT)
X-Received: by 10.182.200.163 with SMTP id jt3mr26760obc.25.1398967768757;
        Thu, 01 May 2014 11:09:28 -0700 (PDT)
In-Reply-To: <3c02d482-360c-40fc-973c-7a348566d2ff@isocpp.org>
X-Original-Sender: germandiago@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:10473
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/10473>

------=_Part_54_25944340.1398967767438
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

In 2. I forgot to mention that the library solution would be something like=
=20
poly<myclass>, that would
generate a class that has the same interface as myclass, but it's=20
polymorphic.

We also should consider how a poly_ref<myclass> should behave.



El viernes, 2 de mayo de 2014 01:04:08 UTC+7, germa...@gmail.com escribi=C3=
=B3:
>
> Hello everyone,
>
> There is a thing I am really interested in that I think would be of=20
> general interest for the c++ community.
> I would like to generate some discussion on the topic. The intention of=
=20
> this post is to collect ideas
> and prior art to any-type like erasure.
>
> So far we have library versions of any-type like erasure, but none of the=
m=20
> is perfect. For reference
> on the available solutions I will leave here the excellent blog entries=
=20
> from Andrzej:
>
>     http://akrzemi1.wordpress.com/2013/11/18/type-erasure-part-i/
>     http://akrzemi1.wordpress.com/2013/12/06/type-erasure-part-ii/
>     http://akrzemi1.wordpress.com/2013/12/11/type-erasure-part-iii/
>     http://akrzemi1.wordpress.com/2014/01/13/type-erasure-part-iv/
>     =20
> What I wonder is how we could approach a perfect solution to have this=20
> into the language avoiding the=20
> boiler-plate.
>
> For now I can think of several solutions:
>
> 1. Build type erasure directly into the language. This would require=20
> maybe, and would be related also
> to overloading operator. (which currently cannot be done). Overloading=20
> this operator could enable
> classes like copy_on_write<T> and optional<T> to have the same interface=
=20
> as the original class,
> but this goes beyond the intention of this research.
> 2. Take advantage of static type reflection<http://www.open-std.org/jtc1/=
sc22/wg21/docs/papers/2014/n3951.pdf>
>  + code generation<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/201=
4/n3883.html> to=20
> build a library solution.
> 3. Generate a runtime erased interface from a concept specification?
>
>
> Personally I would like to get rid of traditional OO=20
> inheritance and use this solution all the time, but it=C2=B4s too cumbers=
ome=20
>  in general.
>
> Is there anyone I am not aware of working on this? Looking at Sean=20
> Parent's presentation, I think
> he must have a good idea of what we would need to make this happen?=20
>
>
>

--=20

---=20
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 e=
mail 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-proposa=
ls/.

------=_Part_54_25944340.1398967767438
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">In 2. I forgot to mention that the library solution would =
be something like poly&lt;myclass&gt;, that would<div>generate a class that=
 has the same interface as myclass, but it's polymorphic.</div><div><br></d=
iv><div>We also should consider how a poly_ref&lt;myclass&gt; should behave=
..</div><div><br></div><div><br><br>El viernes, 2 de mayo de 2014 01:04:08 U=
TC+7, germa...@gmail.com  escribi=C3=B3:<blockquote class=3D"gmail_quote" s=
tyle=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-le=
ft: 1ex;"><div dir=3D"ltr">Hello everyone,<div><br></div><div>There is a th=
ing I am really interested in that I think would be of general interest for=
 the c++ community.</div><div>I would like to generate some discussion on t=
he topic. The intention of this post is to collect ideas</div><div>and prio=
r art to any-type like erasure.</div><div><br></div><div>So far we have lib=
rary versions of any-type like erasure, but none of them is perfect. For re=
ference</div><div>on the available solutions I will leave here the excellen=
t blog entries from Andrzej:</div><div><br></div><div>&nbsp; &nbsp;&nbsp;<a=
 href=3D"http://akrzemi1.wordpress.com/2013/11/18/type-erasure-part-i/" tar=
get=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url?q\75ht=
tp%3A%2F%2Fakrzemi1.wordpress.com%2F2013%2F11%2F18%2Ftype-erasure-part-i%2F=
\46sa\75D\46sntz\0751\46usg\75AFQjCNGxuRRUj0AHB-oMDptzSZrquATrjg';return tr=
ue;" onclick=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fakr=
zemi1.wordpress.com%2F2013%2F11%2F18%2Ftype-erasure-part-i%2F\46sa\75D\46sn=
tz\0751\46usg\75AFQjCNGxuRRUj0AHB-oMDptzSZrquATrjg';return true;">http://ak=
rzemi1.wordpress.<wbr>com/2013/11/18/type-erasure-<wbr>part-i/</a><br></div=
><div>&nbsp; &nbsp;&nbsp;<a href=3D"http://akrzemi1.wordpress.com/2013/12/0=
6/type-erasure-part-ii/" target=3D"_blank" onmousedown=3D"this.href=3D'http=
://www.google.com/url?q\75http%3A%2F%2Fakrzemi1.wordpress.com%2F2013%2F12%2=
F06%2Ftype-erasure-part-ii%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFO-A7sqpr5=
9SJmi_zp0SrmoVa62Q';return true;" onclick=3D"this.href=3D'http://www.google=
..com/url?q\75http%3A%2F%2Fakrzemi1.wordpress.com%2F2013%2F12%2F06%2Ftype-er=
asure-part-ii%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNFO-A7sqpr59SJmi_zp0Srmo=
Va62Q';return true;">http://akrzemi1.wordpress.<wbr>com/2013/12/06/type-era=
sure-<wbr>part-ii/</a><br></div><div>&nbsp; &nbsp;&nbsp;<a href=3D"http://a=
krzemi1.wordpress.com/2013/12/11/type-erasure-part-iii/" target=3D"_blank" =
onmousedown=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fakrz=
emi1.wordpress.com%2F2013%2F12%2F11%2Ftype-erasure-part-iii%2F\46sa\75D\46s=
ntz\0751\46usg\75AFQjCNFqlbFNBJmBsSoALvNz3Z8dWgSySQ';return true;" onclick=
=3D"this.href=3D'http://www.google.com/url?q\75http%3A%2F%2Fakrzemi1.wordpr=
ess.com%2F2013%2F12%2F11%2Ftype-erasure-part-iii%2F\46sa\75D\46sntz\0751\46=
usg\75AFQjCNFqlbFNBJmBsSoALvNz3Z8dWgSySQ';return true;">http://akrzemi1.wor=
dpress.<wbr>com/2013/12/11/type-erasure-<wbr>part-iii/</a></div><div>&nbsp;=
 &nbsp;&nbsp;<a href=3D"http://akrzemi1.wordpress.com/2014/01/13/type-erasu=
re-part-iv/" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.googl=
e.com/url?q\75http%3A%2F%2Fakrzemi1.wordpress.com%2F2014%2F01%2F13%2Ftype-e=
rasure-part-iv%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE6-yO-I-SjVbWG5wV9mpPw=
0G3Rdg';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\7=
5http%3A%2F%2Fakrzemi1.wordpress.com%2F2014%2F01%2F13%2Ftype-erasure-part-i=
v%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNE6-yO-I-SjVbWG5wV9mpPw0G3Rdg';retur=
n true;">http://akrzemi1.wordpress.<wbr>com/2014/01/13/type-erasure-<wbr>pa=
rt-iv/</a></div><div>&nbsp; &nbsp; &nbsp;</div><div>What I wonder is how we=
 could approach a perfect solution to have this into the language avoiding =
the&nbsp;</div><div>boiler-plate.</div><div><br></div><div>For now I can th=
ink of several solutions:</div><div><br></div><div>1. Build type erasure di=
rectly into the language. This would require maybe, and would be related al=
so</div><div>to overloading operator. (which currently cannot be done). Ove=
rloading this operator could enable</div><div>classes like copy_on_write&lt=
;T&gt; and optional&lt;T&gt; to have the same interface as the original cla=
ss,</div><div>but this goes beyond the intention of this research.</div><di=
v>2. Take advantage of <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/do=
cs/papers/2014/n3951.pdf" target=3D"_blank" onmousedown=3D"this.href=3D'htt=
p://www.google.com/url?q\75http%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg=
21%2Fdocs%2Fpapers%2F2014%2Fn3951.pdf\46sa\75D\46sntz\0751\46usg\75AFQjCNHX=
a2PzWy0XF9fOcM7tdabFCmqXcw';return true;" onclick=3D"this.href=3D'http://ww=
w.google.com/url?q\75http%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fd=
ocs%2Fpapers%2F2014%2Fn3951.pdf\46sa\75D\46sntz\0751\46usg\75AFQjCNHXa2PzWy=
0XF9fOcM7tdabFCmqXcw';return true;">static type reflection</a>&nbsp;+&nbsp;=
<a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3883.ht=
ml" target=3D"_blank" onmousedown=3D"this.href=3D'http://www.google.com/url=
?q\75http%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2=
014%2Fn3883.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHrWR0lVjck8pCgRSgDxxwUH=
3nfOg';return true;" onclick=3D"this.href=3D'http://www.google.com/url?q\75=
http%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%2Fpapers%2F2014%2=
Fn3883.html\46sa\75D\46sntz\0751\46usg\75AFQjCNHrWR0lVjck8pCgRSgDxxwUH3nfOg=
';return true;">code generation</a>&nbsp;to build a library solution.</div>=
<div>3. Generate a runtime erased interface from a concept specification?</=
div><div><br></div><div><br></div><div>Personally I would like to get rid o=
f traditional OO&nbsp;</div><div>inheritance and use this solution all the =
time, but it=C2=B4s too cumbersome &nbsp;in general.</div><div><br></div><d=
iv>Is there anyone I am not aware of working on this? Looking at Sean Paren=
t's presentation, I think</div><div>he must have a good idea of what we wou=
ld need to make this happen?&nbsp;</div><div><br></div><div><br></div></div=
></blockquote></div></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_54_25944340.1398967767438--

.
