So, I got into the new C ++ using GCC 4.6, which now has for-loop range loops. I found it really nice to repeat arrays and vectors.
Mostly for aesthetic reasons, I wondered if there is a way to use this to replace the standard
for(int i = min; i < max; i++) {}
with something like
for(int& i : std::range(min, max)) {}
Is there something built into the new C ++ standard that allows me to do this? Or do I need to write my own range / iterator class?
c ++ foreach for-loop c ++ 11
Naddiseo
source share