If more control is needed, it could be changed to allow multiple states to point to the same index.
std::fill
std::fill_n