mardi 26 juillet 2016

for_each in place modification with lambda

When I try to use for_each to change vector in place:

vector<bool> sub_accs_ind(vec_ids_.size());
std::for_each(sub_accs_ind.begin(), sub_accs_ind.end(), [](bool& b){ b = false; });

It results in error /usr/include/c++/4.8/bits/stl_algo.h:4417:14: error: no match for call to ‘(AccountsContainer::MakeMap(const VecStr&, AccountsContainer::VecDbl&, AccountsContainer::VecDbl&)::__lambda3) (std::_Bit_iterator::reference)’ __f(*__first);

Could you please guide me about what is wrong here?

Aucun commentaire:

Enregistrer un commentaire