From: Jeff Schwab on
Mathias Gaunard wrote:
> On 13 f�v, 23:23, Jeff Schwab <j...(a)schwabcenter.com> wrote:
>
>> "Type erasure" is the unavailability of some static type information at
>> run-time.
>
> No. Type erasure is "the process of turning a wide variety of types
> with a common interface into one type with that same interface."

I don't know where you are getting that definition, but it is not the
one in common use. For example, see:

http://java.sun.com/docs/books/tutorial/java/generics/erasure.html

It's not just that multiple types have been consolidated behind a single
interface; it is that the original, static type information has actually
been lost.


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Michael Doubez on
On 17 f�v, 01:36, Jeff Schwab <j...(a)schwabcenter.com> wrote:
> Mathias Gaunard wrote:
> > On 13 f�v, 23:23, Jeff Schwab <j...(a)schwabcenter.com> wrote:
>
> >> "Type erasure" is the unavailability of some static type information at
> >> run-time.
>
> > No. Type erasure is "the process of turning a wide variety of types
> > with a common interface into one type with that same interface."
>
> I don't know where you are getting that definition,

>From "C++ template metaprogramming - Concepts [...]" by David Abrahams
and Aleksey Gurtovoy.

> but it is not the
> one in common use. For example, see:
>
> http://java.sun.com/docs/books/tutorial/java/generics/erasure.html
>
> It's not just that multiple types have been consolidated behind a single
> interface; it is that the original, static type information has actually
> been lost.

It is the right definition. In C++ as well, you do lose type
information but you need an envelope to manage the semantic and
forward functions.

--
Michael


--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]