Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-08-03 02:40:34


Cheok Yan Cheng wrote:
> Hi Robert,
>
> I am using VC++ 2003
>
> I must say, the following workaround just work :) :) :)
>
> void load(Archive & ar, const unsigned int version)
> {
> void * xptr;
> xptr = & fiducialPairSearchRegionMap;
> map<FiducialPair *, vector<RectPair> > *mptr;
> mptr = static_cast<map<FiducialPair *, vector<RectPair> >
> >(xptr); ar >> *mptr;
> }
>
> Btw, may I know what is the reason behind of using static_cast
> instead of reinterpret_cast (reinterpert_cast can be compiled too)?
> Is it by following a thumb of rule, "use static_cast if you can and
> use reinterpret_cast if you have to"?

I just used static cast because I thought we couldn't get
reinterpret cast to work. (of course now I don't remember).

When that failed I just "passed" the address through a void *
by casting. I would hope that the compiler is smart enough
to optimize all this stuff away.

>
> Thank you very much!

You're welcome.

>
> yccheok


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net