Skip to content

Commit

Permalink
4th attempt pentru checker
Browse files Browse the repository at this point in the history
  • Loading branch information
radumcostache committed Mar 19, 2023
1 parent f0fda73 commit ac2983a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ class Destination {
float getMatching(Characteristics & prio) {
return prio.getMatching(characteristics);
}
static Destination bestMatch(std::vector<Destination> &v, Characteristics & prio) {
static Destination bestMatch(const std::vector<Destination> &v, const Characteristics & prio) {
float best = 0;
Destination ret;
for (auto it:v) {
float curr = it.getMatching(prio);
float curr = it.getMatching(const_cast<Characteristics &>(prio));

This comment has been minimized.

Copy link
@mcmarius

mcmarius Mar 23, 2023

Nu e ok aici, nu ai citit cu atenție mesajul de eroare; problema era doar la v. De ce faci și parametrul prio const ca apoi să scoți aici const-ul?

if (curr > best) {
best = curr;
ret = it;
Expand Down

0 comments on commit ac2983a

Please sign in to comment.