More make_pair replacements

develop
lethosor 2016-04-22 20:26:07 -04:00
parent ec42967996
commit fd54003384
1 changed files with 8 additions and 8 deletions

@ -1366,12 +1366,12 @@ pair<string, function<bool(df::unit*)>> createRaceFilter(vector<string> &filter_
// guaranteed to exist. // guaranteed to exist.
string race = filter_args[0]; string race = filter_args[0];
return { return make_pair(
"race of " + race, "race of " + race,
[race](df::unit *unit) -> bool { [race](df::unit *unit) -> bool {
return getRaceName(unit) == race; return getRaceName(unit) == race;
} }
}; );
} }
pair<string, function<bool(df::unit*)>> createAgeFilter(vector<string> &filter_args) pair<string, function<bool(df::unit*)>> createAgeFilter(vector<string> &filter_args)
@ -1392,12 +1392,12 @@ pair<string, function<bool(df::unit*)>> createAgeFilter(vector<string> &filter_a
throw runtime_error(err.str()); throw runtime_error(err.str());
} }
return { return make_pair(
"age of exactly " + to_string(target_age), "age of exactly " + to_string(target_age),
[target_age](df::unit *unit) -> bool { [target_age](df::unit *unit) -> bool {
return getAge(unit, true) == target_age; return getAge(unit, true) == target_age;
} }
}; );
} }
pair<string, function<bool(df::unit*)>> createMinAgeFilter(vector<string> &filter_args) pair<string, function<bool(df::unit*)>> createMinAgeFilter(vector<string> &filter_args)
@ -1418,12 +1418,12 @@ pair<string, function<bool(df::unit*)>> createMinAgeFilter(vector<string> &filte
throw runtime_error(err.str()); throw runtime_error(err.str());
} }
return { return make_pair(
"minimum age of " + to_string(min_age), "minimum age of " + to_string(min_age),
[min_age](df::unit *unit) -> bool { [min_age](df::unit *unit) -> bool {
return getAge(unit, true) >= min_age; return getAge(unit, true) >= min_age;
} }
}; );
} }
pair<string, function<bool(df::unit*)>> createMaxAgeFilter(vector<string> &filter_args) pair<string, function<bool(df::unit*)>> createMaxAgeFilter(vector<string> &filter_args)
@ -1444,12 +1444,12 @@ pair<string, function<bool(df::unit*)>> createMaxAgeFilter(vector<string> &filte
throw runtime_error(err.str()); throw runtime_error(err.str());
} }
return { return make_pair(
"maximum age of " + to_string(max_age), "maximum age of " + to_string(max_age),
[max_age](df::unit *unit) -> bool { [max_age](df::unit *unit) -> bool {
return getAge(unit, true) <= max_age; return getAge(unit, true) <= max_age;
} }
}; );
} }
// Filters that take arguments. // Filters that take arguments.