|
-
September 24th, 2002, 08:35 AM
#1
Explicit template instanciation
Hi,
In "C++ programming Language" from Bjarne Stroustrup, it is told that it's possible to instanciate (explicitly) a class template, a function template or just a member of a class template. I want to instanciate a function template of a class that is not a template itself. So, that case isn't covered in the book. I try few things as :
Code:
// My class that is not a template (in .h file) :
class CVar
{
...
template< typename T >
T* ValueGetToken( T* buf_, int buflen_ ) const;
...
};
// Explicit instanciation (in .cpp file) :
template char* CVar::ValueGetToken( char*, int ) const;
I'm always having the same linking problem. So my function isn't instanciate. Is it possible to do this? I'm compiling with Visual C++ 6 (I know it's not the reference for working with templates but I have no choice since it's the compiler my company uses).
thanks,
Martin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|