c++ loop trhought object

C++
for (auto const& i : data) {
    std::cout << i.name;
}
Source

Also in C++: