Re: problem with binding operator
DA SILVA Antonio <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Hi
I think you have to write something like:
void LuaString8(lua_State *L)
{
module(L)
[
luabind::class_<Str8>("Str8")
.def( "toCChar8", ( CChar8*( Str8::* )( ) )&Str8::operator( ) )
and then into LUA you call "myStr8.toCChar8( )"
Le 18/03/2011 05:54, martin nilsen a écrit :
> Just starting Luabinding and run into some problems with () operators,
> havent read anything about luabind not supporting those.
> struct Str8 // Text String (8-bit per character)
> {
> // get
> operator CChar8*()C {return _d.data();} // cast to CChar8*
> CChar8* operator()( )C {return _d.data();} // get text data
>
>
> void LuaString8(lua_State *L)
> {
> module(L)
> [
> luabind::class_<Str8>("Str8")
> .def(CChar8*())
>
>
> error C2059: syntax error : ')'
>
>
>
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d