This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

template pointer operator conversion


//using gcc 2.95.2, the following generates a compilation
//error, unable to resolve the pointer.
//specifically:
//tt.cpp: In function `int func()':
//tt.cpp:26: `class tclass<int>' used where a `int' was expected
//But instancing the class separately solves the problem!!
//#define NO_COMPILE_ERROR

template<class vtype>
class tclass
{
	vtype x;
public:
  	operator vtype(){ return x;}
};


tclass<int>  *tcl;

#ifdef NO_COMPILE_ERROR
tclass<int>  tcli;
#endif

int func(void)
{
	int d = *tcl;
	return 0;
}


----------------------
CONFIDENTIALITY NOTICE
----------------------
This email is intended only to be read or used by the addressee.
The information contained in this e-mail message may be confidential
information. If you are not the intended recipient, any use, interference
with, distribution, disclosure or copying of this material is unauthorised
and prohibited. Confidentiality attached to this communication is not waived
or lost by reason of the mistaken delivery to you.

If you have received this message in error, please delete it and notify us
by return e-mail or telephone Aristocrat Technologies Australia Pty Limited
on +61 2 9413 6300.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]