Open eszabo12 opened 3 years ago
Well, I'm using Visual Studio. What parameters exactly are you talking about?
I think it's because the operator function in the Bird class is "bool Bird::operator<(Bird& i_bird)", not "bool Bird::operator<(const Bird& i_bird)".
I didn't add const because of get_fitness().
I'm using
g++ -std=c++17 Main.cpp -o a
and getting
sr/bin/../include/c++/v1/algorithm:715:71: error: invalid operands to binary expression ('const Bird' and 'const Bird') bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
2 warnings and 1 error generated.
what were your compilation parameters?