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

Responder a