Skip to content

Commit

Permalink
Fixed newer compiler warnings about lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-novo authored Feb 26, 2017
1 parent a137d60 commit 56f442a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bankacct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int main() {
if(dbName == nullptr) return 1;

//Sort by Account number
sort(people.begin(), people.end(), [](Account& a, Account& b) {
sort(people.begin(), people.end(), [](const Account& a, const Account& b) {
return strcmp(a.number, b.number) < 0;
});

Expand Down Expand Up @@ -1170,7 +1170,7 @@ void openAccount(vector<Account>* people) {
if(strlen(buf) != 6) break;
strcpy(newPerson.password, buf);
people->push_back(newPerson);
sort(people->begin(), people->end(), [](Account& a, Account& b) {
sort(people->begin(), people->end(), [](const Account& a, const Account& b) {
return strcmp(a.number, b.number) < 0;
});
return;
Expand Down

0 comments on commit 56f442a

Please sign in to comment.