use std::size_t instead of unsigned int;
in general prefix (++i) is desirable over (i++) although the compiler probably optimizes that out