Jeremy,
Just to keep you informed: the code compiles well for the 0.1.7 tag on
both machines, but fails for both on the trunk.
> The prototype for ref_ptr::get looks like this:
>
> T* get() const { return _ptr; }
>
After reviewing the 0.1.7 code, this makes perfect sense. It is legal
to get a non const reference from a const list of ref_ptr<>s.
But the trunk uses observer_ptr<> instead. And this observer_ptr<>
does *not* define the const method returning a non const pointer.
I really don't know why it is this way - I had actually never noticed
that ref_ptr<> had this "feature". It makes more sense to me how the
observer_ptr<> is implemented because ref_ptr and observer_ptr are
just proxies that should IMHO behave like ordinary references or
pointers when we call operator*() or operator->(). (I'm sure a C++
guru could slap me for what I've said, but I'd enjoy it if it came
with an explanation :)
> It's a const method that returns a non-const pointer. I've done a bit of
> research, and this does appear to be something some compilers catch and
> some don't, so I'm not sure how OSG builds for any of us if we really
> adhering to some strict checking.
OSG does compile well with VS 9.0 and my (weird?) GCC 4.1.2 ...
To be continued I guess.
Thibault
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org