Его можно заменить
/* main.cpp */
#include <iostream>
using namespace std;
/* struct Empty */
struct Empty
{
};
/* class IntRange */
class IntRange
{
int ind;
int lim;
public:
IntRange(int ind_,int lim_) : ind(ind_),lim(lim_) {}
// loop
bool operator != (Empty) const { return ind<lim; }
int operator * () const { return ind; }
void operator ++ () { ind++; }
// begin()/end()
IntRange begin() const { return *this; }
Empty end() const { return {}; }
};
/* main() */
int main()
{
// for(int i=0; i<10 ;i++)
for(int i : IntRange(0,10) ) cout << i << ' ' ;
cout << endl << endl ;
return 0;
}