I came across some code with various typedefs as follows:
class GAGenome : public GAID {
public: GADefineIdentity("GAGenome", GAID::Genome);
public:
typedef float (*Evaluator)(GAGenome &);
typedef void (*Initializer)(GAGenome &);
typedef int (*Mutator)(GAGenome &, float);
typedef float (*Comparator)(const GAGenome&, const GAGenome&);
typedef int (*SexualCrossover)(const GAGenome&, const GAGenome&,
GAGenome*, GAGenome*);
typedef int (*AsexualCrossover)(const GAGenome&, GAGenome*);
//some other code
I don't understand the 'typedef' usage here, so can anyone teach me what does it mean? It looks a little bit complex here.
publickeywords alone indicate that; the omnipresent&for references is also indicative.typedefs; the bit that has me puzzled is the meaning of theGADefineIdentity("GAGenome", GAID::Genome);line. If it is a macro (perish the thought), then maybe it makes sense; but as code in a class definition ... I'm puzzled.