|
From: Pierre R. <pie...@wa...> - 2003-03-21 11:36:23
|
Hello,
I'm using Dev-Cpp 4.9.7.0, GCC 3.2, MingW 2.0.0.3, Msys 1.0.7, under =
Windows Me.
I'd like to use a new type of smart pointer but without changing all the =
reference in the code. I try the code below:
- in a header file cptr.h, I have:
template < class T > =20
class CPtr // Counted Pointer =20
{ =20
[...]
}; // CPtr=20
- and in an other file, I put:
[...]
#include <string>
#include "include/cptr.h" // smart pointer CPtr
[...]
using std::string ;
typedef CPtr smart_ptr ;
//#define smart_ptr CPtr
typedef smart_ptr< string > StringPtr ;
[...]
The compiler gives a "syntax error before ;" for the line "define CPtr =
smart_ptr;".
Everything is OK if I use "#define CPtr smart_ptr".=20
I don't see where is the point with this error? Any idea?
Thanks
Pierre Raoul
|