[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Binding template classes
- From: "derek derek" <derek_in@...>
- Date: Thu, 06 Jul 2006 15:09:58 +0800
hi list,how to unsubscribe the mail list, it make my mailbox full,maybe I
need another mailbox to subscribe it
From: Ariel Manzur <listas@anime.com.ar>
Reply-To: Lua list <lua@bazar2.conectiva.com.br>
To: Lua list <lua@bazar2.conectiva.com.br>
Subject: Re: Binding template classes
Date: Thu, 6 Jul 2006 00:05:52 -0400
Hi.
On Wed, Jul 05, 2006 at 11:54:51AM -0700, Nick Tourte wrote:
> I'm attempting to write a wrapper class for a vector for lua binding,
and
> the tolua++ reference manual implies that you can do just that and
simply,
> too. The example is just a class in terms of T (which I presume is a
simple
> typedef), wherein the T is replaced in tolua's internals via the
> TOLUA_TEMPLATE_BIND macro. Unfortunately, when I compile the generated
.cpp
The example on the manual shows the code that goes into the pkg file. The
class _is_ a template, you just have to leave the 'template <class T>'
part out of the pkg file. The actual header has the template stuff.
The example on the manual will probably work with the std::vector class,
you'll probably have to do 'using std::vector;' first.
> file, it gives me compiler errors because the class that I wrote was
not a
> template class (as the example is not either), and yet tolua++ has
Of course, if your class is not a template, you can just declare it
normally on the pkg like any other class, no need for templates at all..
:)
> interpreted the code in such a way as to translate the class into a
template
> class. Furthermore, when I tried to make the class a template class, it
> wouldn't even compile into the .cpp file, presumably because tolua
doesn't
> recognize the template directive. Help?
>
> Nick
>
Ariel.
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com