Trivial pointers result in unregistered class

Daniel Walter <[email protected]> Tue, 18 Jun 2013 16:41:17 +0200
Newsgroups gmane.comp.lang.lua.bind.user
Organization Helm & Walter IT-Solutions
Message-ID <[email protected]>
Hi folks,

I have a struct with some pointers to trivial datatypes like this:

struct A {
     int* x;
     int* y;
};

I bound it to lua like this:

luabind::module(L)
[
      luabind::class_<A>("A")
     .def_readonly("x", &A::x)
     .def_readonly("y", &A::y)
];

If I am using this class in my lua script the runtime throws this 
exception: "Trying to use unregistered class"
I managed this using a getter function returning the dereferenced 
pointer, but there must be a better way.

The same exception happens when i am using such an trivial pointer directly:

int* x = new int(42);
luabind::globals(L)["x"] = x;

How to handle this? What i am missing?

Thanks in advance,
Daniel

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev