Kofybrek / Flappy-bird-AI

AI that learns to play the game Flappy Bird.
GNU General Public License v3.0
59 stars 14 forks source link

invalid operands to binary operator #1

Open eszabo12 opened 3 years ago

eszabo12 commented 3 years ago

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?

Kofybrek commented 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().