Member pointers in 0.8.1

Ilia Trendafilov <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Hello guys,

I tried upgrading to 8.1 today and got hit by this strange problem:
class A has a public member of type B*, when I create an instance of B
(in Lua) and try to assign it to the member (in Lua) I get the
following error:
---
No matching overload found, candidates:
void <unknown>(A&,B* const&)
---

Here's a code sample:
----
#include <luabind/luabind.hpp>
extern "C"
{
	#include <lua.h>
	#include <lualib.h>
	#include <lauxlib.h>
};


struct B {};
struct D1 : B {};
struct D2 : D1 {};
struct A { B* b; };


int main(int argc, char* argv[])
{
	using namespace luabind;

	lua_State* l= lua_open();

	if (l)
	{
		luaL_openlibs(l);
		open(l);
		module(l)
			[
				class_<A>("A").def(constructor<>()).def_readwrite("b", &A::b),
				class_<B>("B").def(constructor<>())
			];

		int status = luaL_dostring(l, "a = A(); a.b = B();");
		if (status != 0)
		{
			const char* s = lua_tostring(l, 1);
			printf("%s\n", s);
		}

		lua_close(l);
		l= NULL;
	}
}
----

Tried with both static library and DLL build of luabind with VC8 SP1
(VC2005), as well as shared libraries build on Linux (gcc4.3.2), same
story everywhere. This used to work on 0.7.1. I checked the changes
since 0.7.1 but didn't find anything related.

Thanks,
Ilia

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
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.