Steve: wrote:
> Hi,
>
> With a normal class, I can do the following:
>
> ---
> class Foo;
>
> void func( Foo* param );
>
> class Foo
> {
> //defined here
> };
> ---
>
>
> How do I declare a templated class before the actual definition?
>
> ---
> class WStr; // Does not work, the compiler complains about
> redifinition.
template<class T> class Tmpl;
>
> void func( WStr* param );
If this is a concrete function (with a certain template specialisation
as the argument type), then do
void func( Tmpl<char>* param );
If it does not work for you, maybe you can put the declaration after
the definition of 'Tmpl' class.
>
> template< class T >
> class Tmpl
> {
> //defined here
> T* t;
> };
>
> typedef Tmpl< char > WStr;
> ---
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask