You are declaring your values as unsigned so when i goes from 0 to -1 it is treated as the unsigned value 0xFFFFFFFF, and the loop goes on forever. If you change the second loop statement to
for (auto i = 2u; i > 0u; --i)
for (auto i = 2u; i != 0xFFFFFFFFu; --i)
for (auto i = 2; i >= 0; --i)
it will work. It is better to use signed numbers as much as possible to avoid issues such as this.