This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Two errors creating a converter between two types
- From: John Love-Jensen <eljay at adobe dot com>
- To: tirengarfio <tirengarfio at hotmail dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Thu, 23 Aug 2007 06:33:49 -0500
- Subject: Re: Two errors creating a converter between two types
Hi tirengarfio,
You are making a cast operator.
Cast operators have no parameters, hence they are 'void'.
So your int parameter is not allowed.
What would that look like, anyway, when used...
CEntrada* ptr = (CEntrada*) taquilla (7);
...? Can't be that, since that's not a cast operator.
Must be (although still invalid)...
CEntrada* ptr = taquilla.operator CEntrada*(7);
...which rather defeats the purpose of a cast operator.
Probably should make an accessor:
CEntrada* GetEntradaPtr(int i);
Or:
CEntrada* operator [] (int i);
HTH,
--Eljay