If I have a std::vector or std::map variable, and I want to see the contents, it\'s a big pain to see the nth element while debugging. Is there a p
In vs 2015, I could not get any of these working
so, i wrote a bit of code
std::vector vs(M_coins + 1);
for (unsigned long long i = 0; i <= M_coins; i++) {
std::for_each(memo[i].begin(), memo[i].end(), [i, &vs](long long &n) {
vs[i].append(std::to_string(n));
});
}
// now vs is ready for use as vs[0], vs[1].. so on, for your debugger
basically what i did was converted vector into string. i had vector of vector so i had string vector to fill.
std::vector s;
std::for_each(v1.begin(), v1.end(), [&s](long long &n) {
s.append(std::to_string(n));
});
// now s is ready for use, for your debugger
hope it helped.