Creo que vas a tener que poner un poco más de código.

¿No será un problema de namespace? ¿Singleton está dentro de algún
namespace?

Probá:

<NameSpaceDeSingleton>::Pieza * piezaOrigen = t->getPieza();

Obviamente poné el namespace que sea en <NameSpaceDeSingleton>


On 29/03/2008, Carlos Pantelides <[EMAIL PROTECTED]> wrote:
>
> Estiamados/as:
>
> Tengo un singleton, sacado de Design Patterns (Gof):
>
> ----------------------------------------------------
> // Singleton.h
> #include "Pieza.h"
>
> class Singleton {
>         public:
>         static Singleton * getInstance();
>         Pieza * getPieza();
>
>         private:
>         static Singleton * instance;
>         Singleton();
> };
>
> ----------------------------------------------------
> // Singleton.cpp
>
> #include "Singleton.h"
>
> Singleton * Singleton::instance=0;
>
> Singleton * Singleton::getInstance() {
>         if (instance==0) {
>                 instance = new Singleton();
>         }
>         return instance;
> }
>
> ----------------------------------------------------
>
> Y lo intento usar:
>
> #include "Pieza.h"
> #include "Singleton.h"
>
> Singleton * t = Singleton::getInstance();
> Pieza * piezaOrigen = t->getPieza();         <<<<<
>
> y al compilar me tira en <<<<<:
>
> argument of type 'Pieza* (Singleton::)()' does not
> match 'Pieza*'
>
>
> Tendría alguien la amabilidad de explicarme que está
> ocurriento?
>
> Gracias anticipadas
>
>
> Carlos Pantelides
>
>
>
>
>       
> ____________________________________________________________________________________
> OMG, Sweet deal for Yahoo! users/friends:Get A Month of Blockbuster Total
> Access, No Cost. W00t
> http://tc.deals.yahoo.com/tc/blockbuster/text2.com
> _______________________________________________
> Lista de correo Programacion.
> [email protected]
> http://listas.fi.uba.ar/mailman/listinfo/programacion
>



-- 
_Leo_
[http://www.eeeuser.com.ar - http://blog.drk.com.ar]
_______________________________________________
Lista de correo Programacion.
[email protected]
http://listas.fi.uba.ar/mailman/listinfo/programacion

Responder a