problem with binding operator

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

problem with binding operator

martin nilsen
Basically if I try to to use either Str //16 bit or Str8 //8bit string
as command lua crashes the app because it can't convert
So how can I make it possible to use Str and Str8 as constructor or in
functions without making the program crash?

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
    Char8  operator[](Int  i)C;                    // get  i-th
character, returns '\0' if 'i' is out of range

   Str8(         );
   Str8(Char    c); //16bit
   Str8(Char8   c); //8bit
   Str8(CChar  *t); //16bit
   Str8(CChar8 *t); //8bit
   Str8(C Str  &s); //16bit
   Str8(C Str8 &s); //8bit

private:
   Mems<Char8> _d;
   Int         _length;

   friend struct _List;
};

--
Later

------------------------------------------------------------------------------
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
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user