Original Post
Might be an easy one, but havent been able to find this using the search function. My problem is that I want to cast the this pointer into a boost::shared_ptr I have some resources, shaders, textures, surfaces, geometry. All inheriting from the same base resouce class. class D3DResource { public: D3DResource (ResourceType _resourceType) { ResourceAllocator::Get->addResouce (this); } }; typedef boost::shared_ptr ptr_d3d_resource; The problem is that the ResouceAllocators add method : void add (boost::shared_ptr resource); Any advice on howto go about this? Should I re-think the resouce system?