class one
{
private:
std::string a;
int b;
bool c;
vector one_v;
...
цикл от 1 до 5
one *o=one_v.at(i);
if (o.a=='Вася')
s++
#include <algorithm>
#include <iostream>
class one
{
public:
one(std::string a) : _a(a) { }
std::string a() { return _a; }
private:
std::string _a;
int b;
bool c;
};
int main() {
const std::vector<one> ones = {
one("Vasya"),
one("Meh"),
one("Foo"),
one("Vasya"),
one("Vasya"),
one("Bar")
};
std::cout << std::count_if(
ones.cbegin(), ones.cend(),
[](one o){ return o.a() == "Vasya"; }
);
return 0;
}