how to retrieve object from the list c++ by using iterator code example Example: c++ loop trhought object for (auto const& i : data) { std::cout << i.name; }