This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: typedef and pass variable
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Mohsen Pahlevanzadeh <mohsen at pahlevanzadeh dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 9 Jul 2012 09:13:35 +0100
- Subject: Re: typedef and pass variable
- References: <1341818825.5396.8.camel@debian> <1341821023.5396.14.camel@debian>
On 9 July 2012 09:03, Mohsen Pahlevanzadeh wrote:
> I changed the given func to the :
> ///////////////////////////////////
> template <class T,class MyCLass>
> Class *makeInstance(T *_class,Method _method,Class* _instance_class,ReturnType _returnType,Parameter1 parameter1,Parameter2 parameter2, Parameter3 parameter3, Parameter4 parameter4){
> typedef (&_class) __class ;
1) __class is not a legal name, do not use names containing a double
underscore, or names beginning with underscore followed by uppercase
letter, they are reserved for the implementation.
2) &_class has type T**, i.e. it is the address of a pointer, it's not
a type, let alone a class type.
Surely the type you want is named by one (or both) of the template
parameters T and Class.