This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template pointer operator conversion
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: template pointer operator conversion
- From: Peter Garrone <Garrone at ali dot com dot au>
- Date: Thu, 25 Jan 2001 16:45:23 +1100
//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.