Topic: Researching any-like general type erasure


Author: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Date: Thu, 1 May 2014 21:00:00 +0200
Raw View
--bcaec5299f9bd467ab04f85b46a3
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Boost.TypeErasure is a state of the art type erasure library. Be sure to
check it out.

Roman Perepelitsa.


2014-05-01 20:09 GMT+02:00 <germandiago@gmail.com>:

> In 2. I forgot to mention that the library solution would be something
> like poly<myclass>, that would
> generate a class that has the same interface as myclass, but it's
> 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
>> general interest for the c++ community.
>> I would like to generate some discussion on the topic. The intention of
>> 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
>> them is perfect. For reference
>> on the available solutions I will leave here the excellent blog entries
>> 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/
>>
>> What I wonder is how we could approach a perfect solution to have this
>> into the language avoiding the
>> boiler-plate.
>>
>> For now I can think of several solutions:
>>
>> 1. Build type erasure directly into the language. This would require
>> maybe, and would be related also
>> to overloading operator. (which currently cannot be done). Overloading
>> this operator could enable
>> classes like copy_on_write<T> and optional<T> to have the same interface
>> 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/20=
14/n3883.html> to
>> build a library solution.
>> 3. Generate a runtime erased interface from a concept specification?
>>
>>
>> Personally I would like to get rid of traditional OO
>> inheritance and use this solution all the time, but it=C2=B4s too cumber=
some
>>  in general.
>>
>> Is there anyone I am not aware of working on this? Looking at Sean
>> Parent's presentation, I think
>> he must have a good idea of what we would need to make this happen?
>>
>>
>>  --
>
> ---
> 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/.
>

--=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/.

--bcaec5299f9bd467ab04f85b46a3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Boost.TypeErasure is a state of the art type erasure libra=
ry. Be sure to check it out.<br><div><br></div><div>Roman Perepelitsa.</div=
></div><div class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">2014-0=
5-01 20:09 GMT+02:00  <span dir=3D"ltr">&lt;<a href=3D"mailto:germandiago@g=
mail.com" target=3D"_blank">germandiago@gmail.com</a>&gt;</span>:<br>

<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">In 2. I forgot to mention t=
hat 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&#39;s polym=
orphic.</div><div><br></div><div>We also should consider how a poly_ref&lt;=
myclass&gt; should behave.</div><div><br></div><div><br><br>El viernes, 2 d=
e mayo de 2014 01:04:08 UTC+7, <a href=3D"mailto:germa...@gmail.com" target=
=3D"_blank">germa...@gmail.com</a>  escribi=C3=B3:<div>

<div class=3D"h5"><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
Hello everyone,<div><br></div><div>There is a thing 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 the topic. The intention o=
f this post is to collect ideas</div><div>and prior art to any-type like er=
asure.</div><div><br></div><div>So far we have library versions of any-type=
 like erasure, but none of them is perfect. For reference</div>

<div>on the available solutions I will leave here the excellent blog entrie=
s from Andrzej:</div><div><br></div><div>=C2=A0 =C2=A0=C2=A0<a href=3D"http=
://akrzemi1.wordpress.com/2013/11/18/type-erasure-part-i/" target=3D"_blank=
">http://akrzemi1.wordpress.<u></u>com/2013/11/18/type-erasure-<u></u>part-=
i/</a><br>

</div><div>=C2=A0 =C2=A0=C2=A0<a href=3D"http://akrzemi1.wordpress.com/2013=
/12/06/type-erasure-part-ii/" target=3D"_blank">http://akrzemi1.wordpress.<=
u></u>com/2013/12/06/type-erasure-<u></u>part-ii/</a><br></div><div>=C2=A0 =
=C2=A0=C2=A0<a href=3D"http://akrzemi1.wordpress.com/2013/12/11/type-erasur=
e-part-iii/" target=3D"_blank">http://akrzemi1.wordpress.<u></u>com/2013/12=
/11/type-erasure-<u></u>part-iii/</a></div>

<div>=C2=A0 =C2=A0=C2=A0<a href=3D"http://akrzemi1.wordpress.com/2014/01/13=
/type-erasure-part-iv/" target=3D"_blank">http://akrzemi1.wordpress.<u></u>=
com/2014/01/13/type-erasure-<u></u>part-iv/</a></div><div>=C2=A0 =C2=A0 =C2=
=A0</div><div>What I wonder is how we could approach a perfect solution to =
have this into the language avoiding the=C2=A0</div>

<div>boiler-plate.</div><div><br></div><div>For now I can think of several =
solutions:</div><div><br></div><div>1. Build type erasure directly into the=
 language. This would require maybe, and would be related also</div><div>

to overloading operator. (which currently cannot be done). Overloading this=
 operator could enable</div><div>classes like copy_on_write&lt;T&gt; and op=
tional&lt;T&gt; to have the same interface as the original class,</div>

<div>but this goes beyond the intention of this research.</div><div>2. Take=
 advantage of <a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers=
/2014/n3951.pdf" target=3D"_blank">static type reflection</a>=C2=A0+=C2=A0<=
a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3883.htm=
l" target=3D"_blank">code generation</a>=C2=A0to 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=C2=A0</div><div>inheritance and use this solution all the =
time, but it=C2=B4s too cumbersome =C2=A0in general.</div>

<div><br></div><div>Is there anyone I am not aware of working on this? Look=
ing at Sean Parent&#39;s presentation, I think</div><div>he must have a goo=
d idea of what we would need to make this happen?=C2=A0</div><div><br></div=
>

<div><br></div></div></blockquote></div></div></div></div><div class=3D"HOE=
nZb"><div class=3D"h5">

<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" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br></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 />

--bcaec5299f9bd467ab04f85b46a3--

.