Function object: Difference between revisions

Content deleted Content added
Adding local short description: "Programming construct", overriding Wikidata description "programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax"
Gromolyak (talk | contribs)
Tags: Mobile edit Mobile app edit Android app edit
Line 79:
}
bool operator()(const Employee& a, const Employee& b) const
{
if (SORT_FIELD == "name")
Line 113:
/* code to populate database */
const std::string sort_field = "idnum";
std::sort(emps.begin(), emps.end(), [&sort_field](const Employee& a, const Employee& b) const { /* code to select and compare field */ });
return 0;
}