Add gen distribute

Just one warning from clang removed.
You can leave out the "Split long lines." commit.
why  `unsigned` here? i thought sizt_t is defined to represent a length of a vector...