problem with binding operator

martin nilsen <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
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
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.