Hi all, I'm trying to prune out the number of includes in my headers, in order 
to keep from including OSG in all parts of my application.
I have a couple of places where I would like to forward declare osg::ref_ptr<>, 
but so far I have had no success with that.
Specifically, I would like to forward declare:

osg::ref_ptr<osg::Material>
And
osg::ref_ptr<osg::Node>

I tried adding:

namespace osg
{
class Node;
class Material;
template <typename T> class ref_ptr;
};

To the header file as suggested in the thread titled "Forward declared classes 
and ref_ptrs", but I'm still getting the following error:
error C2079: 'asg::ASGContainer::m_osgroot' uses undefined class 
'osg::ref_ptr<T>'

I searched a bit on the internet and saw that in Boost they had made some 
special additions to their reference counted pointer in order to enable forward 
declarations.
If osg::ref_ptr doesn't support forward declarations, I can of course refactor 
my classes a bit in order to control which ones include OSG, but I would prefer 
using the forward declaration.

Regards, and some forward declared thanks :)

Jesper D. Thomsen
AnyBody Technology A/S

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to