30 Apr
2003
30 Apr
'03
4:40 p.m.
Dear Darin,
boost::shared_ptr<int const> sp2(&a);
The way const works with shared_ptr is similar to the way it works with plain pointers. You can have a constant pointer, which means the pointer can't be modified, or a pointer to constant, which means the object that's pointed to can't be modified.
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?
Hope that helps. Yes, it was.
Thanks a lot, --Hossein __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com