std::shared_ptr support

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

std::shared_ptr support

Joshua Boyce-2
Hello, I am currently using Luabind (the latest version from the 0.9 GIT branch) under MSVC 10 and am having a problem binding APIs which use smart pointers.

I have a bunch of APIs like so (psuedocode):
std::shared_ptr<Foo> GetFoo();

When I bind these however I get a 'trying to use unregistered class' error. If I change 'std::shared_ptr' to 'boost::shared_ptr' or 'std::auto_ptr' it works, however std::shared_ptr refuses to. Even though I have provided the necessary get_pointer overload(s):

namespace luabind { template <typename T> T* get_pointer(std::shared_ptr<T> const& p) { return p.get(); }

Some help getting this working would be greatly appreciated as the library I'm trying to bind uses std::shared_ptr everywhere and I don't have the luxury of being able to change that to use boost::shared_ptr as it would break too much existing code.

Thanks in advance.

Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
luabind-user mailing list
[hidden email]