HI Craig,
As author of both ref_ptr<> and obsrver_ptr<> I must admit that I
hadn't realised that the two implementation differed in this respect,
the observer_ptr<> came about 6 years after the ref_ptr<> so this
probably explains it more than anything else. Normally I will always
return a const object form a const method, so the ref_ptr<> is
different, the question is why, did I write it before I knew any
better, or was it purely out of convinience when using ref_ptr<>,
actually I suspect this is the reason as cases like when you have a
set<ref_ptr<>> the ref_ptr<> will be const which is a real pain when
it comes to accessing the data. Given this reasoning it would
probably be sensible to relax oberserver_ptr<>.
Robert
On Jan 18, 2008 7:18 PM, Craig Bosma <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I was hoping someone might be willing to explain to me the difference in
> const-semantics between ref_ptr and observer_ptr, i.e. why is it that I
> can get a non-const pointer from get() on a const ref_ptr, but not from
> an observer_ptr? Is this by design?
>
> osg/ref_ptr
> T* get() const { ... }
>
> osg/observer_ptr
> T* get() { ... };
> const T* get() const { ... }
>
> I only ask because it caused me some confusion the other day when
> converting some ref_ptrs to observer_ptrs and vice versa.
>
> Thanks,
> Craig
>
> This e-mail and any attachments are provided through AEgis
> Technologies' e-mail services and may contain company sensitive and/or
> privileged information. If you are not the intended recipient, please
> notify the sender immediately by return e-mail, delete this e-mail and
> destroy any copies. Any dissemination or use of this information by a
> person other than the intended recipient is unauthorized and may be
> illegal.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org