The C++ ILOG Cplex API are "not-idiomatic" at least. Here a useful reference on when to use end() on Ilo*Extractable objects.…