a more verbose implementationto point to possible bug c++11 loop may not be same as foreach ??