Kofybrek / Flappy-bird-AI

AI that learns to play the game Flappy Bird.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

invalid operands to binary operator

eszabo12 opened this issue · comments

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?

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