Smart Pointer Usage with derviable class?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Smart Pointer Usage with derviable class?

sf-mail
I have a class that I want to derive from in lua, with a smart-pointer
like container but I'm getting template compilation errors and I can't
figure out what's missing. Actor has a private constructor, but Actor_w
and ActorId do not.

class ActorId {
 // blah blah
// other stuff here too but this is the end result of *id
 Actor *operator *() const { return a; }
 // blah blah
};

void initActor() {
// blah blah
        module(L) [
         class_<Actor, Actor_w, ActorId>("Actor")
         .def(constructor<>()) // this line causes failure, see below
// blah blah
        ];
}

If I remove the .def(constructor<>()) line it compiles fine, so I'm not
sure what I'm missing here.

Errors are here:

http://pastebin.org/172694

This is with VS2010 Pro edition, boost 1.42.1, and luabind 0.9.


------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Smart Pointer Usage with derviable class?

Schala Zeal
You need the 0.9 branch from the Git repository. It fixes VC10 issues
pretty much.

On Sat, Apr 24, 2010 at 1:04 AM,  <[hidden email]> wrote:

> I have a class that I want to derive from in lua, with a smart-pointer
> like container but I'm getting template compilation errors and I can't
> figure out what's missing. Actor has a private constructor, but Actor_w
> and ActorId do not.
>
> class ActorId {
>  // blah blah
> // other stuff here too but this is the end result of *id
>  Actor *operator *() const { return a; }
>  // blah blah
> };
>
> void initActor() {
> // blah blah
>        module(L) [
>         class_<Actor, Actor_w, ActorId>("Actor")
>         .def(constructor<>()) // this line causes failure, see below
> // blah blah
>        ];
> }
>
> If I remove the .def(constructor<>()) line it compiles fine, so I'm not
> sure what I'm missing here.
>
> Errors are here:
>
> http://pastebin.org/172694
>
> This is with VS2010 Pro edition, boost 1.42.1, and luabind 0.9.
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> luabind-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/luabind-user
>

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Smart Pointer Usage with derviable class?

sf-mail
> You need the 0.9 branch from the Git repository. It fixes VC10 issues
> pretty much.
>

Updated, still the exact same error output.

Even if I define my own get_pointer method, it doesn't seem to find it.
I'm not sure what's going on here. What does the signature need to look
like?


------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: Smart Pointer Usage with derviable class?

Daniel Wallin
On Sat, Apr 24, 2010 at 04:26:40PM -0700, [hidden email] wrote:
> > You need the 0.9 branch from the Git repository. It fixes VC10 issues
> > pretty much.
> >
>
> Updated, still the exact same error output.
>
> Even if I define my own get_pointer method, it doesn't seem to find it.
> I'm not sure what's going on here. What does the signature need to look
> like?

You should only need a get_pointer() overload. Note that it is found by
ADL, so it needs to live in the same namespace as your smart pointer
type.

--
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user