Add a helper class for cartesian enumerator.