>From: "Alan Bellingham" <[EMAIL PROTECTED]>
> Terje Slettebø <[EMAIL PROTECTED]>:
>
> >>>in this thread, void * is type erasure. More or less the only safe
thing you
> >>>can do with it, is to delete it. You can also cast it back to its
original
>
> [snip David Abrahams demurral]
>
> >Of course,
Terje Slettebø <[EMAIL PROTECTED]>:
>>>in this thread, void * is type erasure. More or less the only safe thing you
>>>can do with it, is to delete it. You can also cast it back to its original
[snip David Abrahams demurral]
>Of course, it depends on whether the type supports polymorphic deletio
>From: "David Abrahams" <[EMAIL PROTECTED]>
> Terje Slettebø <[EMAIL PROTECTED]> writes:
>
> > I understand you (Johan) want to be able to have generic factories, but
then
> > erasing the type is probably not the way to go, and as has been pointed
out
> > in this thread, void * is type erasure. Mo
Terje Slettebø <[EMAIL PROTECTED]> writes:
> I understand you (Johan) want to be able to have generic factories, but then
> erasing the type is probably not the way to go, and as has been pointed out
> in this thread, void * is type erasure. More or less the only safe thing you
> can do with it, i
>From: "Eric Woodruff" <[EMAIL PROTECTED]>
> "Johan Nilsson" <[EMAIL PROTECTED]> wrote in message
> at76e1$2ro$[EMAIL PROTECTED]">news:at76e1$2ro$[EMAIL PROTECTED]...
>
> Anyhow, in my opinion, dynamic_void_cast is completely unnecessary and
takes
> casts away the intent that it is _supposed_ to b
"Eric Woodruff" <[EMAIL PROTECTED]> wrote in message
at7kru$5v7$[EMAIL PROTECTED]">news:at7kru$5v7$[EMAIL PROTECTED]...
>
> "Johan Nilsson" <[EMAIL PROTECTED]> wrote in message
> at76e1$2ro$[EMAIL PROTECTED]">news:at76e1$2ro$[EMAIL PROTECTED]...
> >
> > "Eric Woodruff" <[EMAIL PROTECTED]> wrote in
"Johan Nilsson" <[EMAIL PROTECTED]> wrote in message
at76e1$2ro$[EMAIL PROTECTED]">news:at76e1$2ro$[EMAIL PROTECTED]...
>
> "Eric Woodruff" <[EMAIL PROTECTED]> wrote in message
> at542o$2hq$[EMAIL PROTECTED]">news:at542o$2hq$[EMAIL PROTECTED]...
> >
> > "Johan Nilsson" <[EMAIL PROTECTED]> wrote in
"Eric Woodruff" <[EMAIL PROTECTED]> wrote in message
at542o$2hq$[EMAIL PROTECTED]">news:at542o$2hq$[EMAIL PROTECTED]...
>
> "Johan Nilsson" <[EMAIL PROTECTED]> wrote in message
> at52vi$si6$[EMAIL PROTECTED]">news:at52vi$si6$[EMAIL PROTECTED]...
> [snip]
>
> > I'd like to be able to store referenc
>From: "Terje Slettebø" <[EMAIL PROTECTED]>
> Fails:
>
> struct X { ~X() {} int n; };
> struct Y : X {};
>
> Succeeds:
>
> struct X { ~X() {} };
> struct Y : X { int n; };
Sorry, the destructors should of course be virtual in the above.
Terje
___
Unsu
>From: "Johan Nilsson" <[EMAIL PROTECTED]>
> "Terje Slettebø" <[EMAIL PROTECTED]> wrote in message
> >
> > Here are the results:
> >
> > MSVC 6 - vptr at 0 - It works
> > Intel C++ 7.0 - vptr at 0 - It works
> > g++ 2.95.3 - vptr _not_ at zero - boom! :) It gives an OS protection
error
> > at the
"Johan Nilsson" <[EMAIL PROTECTED]> writes:
> I'd like to be able to store references to objects of arbitrary types in a
> homogenous collection, not requiring them to be derived from a common base
> class. For COM users, that would be something like an "IUnknown in the
> context of standard C++".
"Johan Nilsson" <[EMAIL PROTECTED]> wrote in message
at52vi$si6$[EMAIL PROTECTED]">news:at52vi$si6$[EMAIL PROTECTED]...
[snip]
> I'd like to be able to store references to objects of arbitrary types in a
> homogenous collection, not requiring them to be derived from a common base
> class. For COM
From: "Johan Nilsson" <[EMAIL PROTECTED]>
> "David Abrahams" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > Incidentally, shared_ptr may allow you the kind of type erasure
> > you want. Just a thought...
>
> I' afraid I don't really follow you. Wouldn't
"David Abrahams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Johan Nilsson" <[EMAIL PROTECTED]> writes:
>
> > "David Abrahams" <[EMAIL PROTECTED]> wrote in message
> >
> >> A rather lengthy example with no comments or explanatory text
> >> describing what i
[inlined]
"Terje Slettebø" <[EMAIL PROTECTED]> wrote in message
011401c2a057$f404cf30$60fb5dd5@pc">news:011401c2a057$f404cf30$60fb5dd5@pc...
> >From: "Peter Dimov" <[EMAIL PROTECTED]>
>
> > From: "Johan Nilsson" <[EMAIL PROTECTED]>
> > >
> > > "Peter Dimov" <[EMAIL PROTECTED]> wrote in message
> >
"Terje Slettebø" <[EMAIL PROTECTED]> wrote in message
00e001c2a04e$92f9c190$60fb5dd5@pc">news:00e001c2a04e$92f9c190$60fb5dd5@pc...
> >From: "Johan Nilsson" <[EMAIL PROTECTED]>
>
>
> > The hack makes no 'fixed' assumptions on binary object
> > layout, rather, it relies on the fact that any polymorp
16 matches
Mail list logo