std::equal + lambda version