Re: [boost] Re: Re: Proven ptr<>
by Greg Colvin other posts by this author
Aug 12 2002 9:55PM messages near this date
[boost] Re: Re: Re: Re: Proven ptr<>
|
[boost] Re: Proven ptr<>
At 10:00 AM 08/12/2002, David Abrahams wrote:
> From: "Philippe A. Bouchard" <philippeb@[...].ca>
>
>
> > > I'm not sure if this ptr<> type under discussion works this way, but in
> > > general you can't conformingly use char* arithmetic with offsets to
> find
> > > the sub-parts of non-POD types.
> >
> > The offsets are what static_cast<>s return.
>
> No, static_cast<> returns pointers, not offsets.
>
> The standard doesn't guarantee that the offset calculated from a given
> static_cast will work again, given the same source and target types.
> Actually doing the static_cast is the only portable way to find the Base*
> from a Derived*. Indirection through a function pointer which does the
> static_cast might be an option.
This is the kind of code that is trying to fast, rather
than portable, so indirection through a function pointer
would probably be inappropriate.
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Peter Dimov
Philippe A. Bouchard
David B. Held
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
David B. Held
Philippe A. Bouchard
David Abrahams
David Abrahams
Philippe A. Bouchard
David Abrahams
Philippe A. Bouchard
Philippe A. Bouchard
Philippe A. Bouchard
Greg Colvin
Philippe A. Bouchard
Greg Colvin
Greg Colvin
|