Re: Why isn't this template working?

James Porter <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
Phlox Icon wrote:
> in the .h file:
> template< typename T > T Foo( int enumType, int enumIndex );
> 
> in the cpp file:
> template< typename T >
> T Foo( int x, int y)
> {
> ...
> return a type of enum
> }
> 
> Binding:
> luabind::def( "Foo", (MySpecificEnumType(*) (int, 
> int)) Foo < MySpecificEnumType > )
> 
> error:
> unresolved external symbol "enum MySpecificEnumType __cdecl 
> Foo<enum MySpecificEnumType>(int,int)" 

Is the binding in the same file as the definition of Foo? Otherwise, it 
won't work because the compiler needs access to the full source of Foo 
when instantiating a specialization of it.

- Jim


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
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.