|
From: David M. <dem...@uw...> - 2003-03-21 23:04:58
|
You'll want to use #define CPtr smart_ptr for it to work, although I prefer
typedefs in a situation like this.
At 12:37 PM 21/03/2003 +0100, you wrote:
>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 >
>class CPtr // Counted Pointer
>{
>[...]
>}; // CPtr
>
>- 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".
>
>I don't see where is the point with this error? Any idea?
>
>Thanks
>
>Pierre Raoul
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|