Boost logo

Boost Users :

From: Darin Adler (darin_at_[hidden])
Date: 2003-04-30 11:50:15


On Wednesday, April 30, 2003, at 09:40 AM, Hossein Haeri wrote:

> OK! Now what are the "cast" guarantees? I mean something such as this:
>
> boost::shared_ptr<int> sp3(&a);
> boost::shared_ptr<const int> sp4(sp3);
>
> Is the above code legal? What is the result then?

Yes, it's legal. Both sp3 and sp4 point to a, and sp3 can be used to
modify the value of a, but sp4 can't.

     -- Darin


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