Hello. I wonder of anyone can help me.
I am trying to overload some operators, but it keeps giving me some problems...
I used the same code in another program and it works fine!!!
here is the coding that is giving me grief...
bool Chromosome::ope rator == (const Chromosome& other) const
{
return ((fitness == other.fitness() ));
}
bool Chromosome::ope rator < (const Chromosome& other) const
{
return ((fitness < other.fitness() ));
}
bool Chromosome::ope rator > (const Chromosome& other) const
{
return ((fitness > other.fitness() ));
}
bool Chromosome::ope rator <= (const Chromosome& other) const
{
return ((fitness <= other.fitness() ));
}
bool Chromosome::ope rator >= (const Chromosome& other) const
{
return ((fitness >= other.fitness() ));
}
Thank you very much for your time...
Very much appreciated
I am trying to overload some operators, but it keeps giving me some problems...
I used the same code in another program and it works fine!!!
here is the coding that is giving me grief...
bool Chromosome::ope rator == (const Chromosome& other) const
{
return ((fitness == other.fitness() ));
}
bool Chromosome::ope rator < (const Chromosome& other) const
{
return ((fitness < other.fitness() ));
}
bool Chromosome::ope rator > (const Chromosome& other) const
{
return ((fitness > other.fitness() ));
}
bool Chromosome::ope rator <= (const Chromosome& other) const
{
return ((fitness <= other.fitness() ));
}
bool Chromosome::ope rator >= (const Chromosome& other) const
{
return ((fitness >= other.fitness() ));
}
Thank you very much for your time...
Very much appreciated
Comment