std::shared_ptr support

Joshua Boyce <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
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.
http://p.sf.net/sfu/novell-sfdev2dev

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.