Skip to main content
1 of 2
kevin cline
  • 33.7k
  • 3
  • 72
  • 142

The fastest way to do this is to not do it. Create a new collection class that will iterate over a range of integers, without storing a copy of each one.

class range {
private:
  int low, high;
public:
  range_iterator begin();
  range_iterator end();
}
kevin cline
  • 33.7k
  • 3
  • 72
  • 142