This is a simple implementation of generational indices. It will serve as the basis for you to implement your own Entity Component System. It uses a Mutex so that it can be thread safe.
Please see https://github.com/flajann2/gen-indices for more details.
GenIndexEntitySet This maintains the "state" for your entities. It is designed with a Mutex, so that it is rendered thread safe.