-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathRange.hpp
More file actions
23 lines (18 loc) · 783 Bytes
/
Range.hpp
File metadata and controls
23 lines (18 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef EXPRINTER_RANGE_H
#define EXPRINTER_RANGE_H
#include <vector>
#include "ArithExpr.hpp"
class Range {
public:
Range(int _rangeValue) : initValue{0},
rangeValue{_rangeValue}, stepValue{1} {};
Range(int _initValue, int _rangeValue) : initValue{_initValue},
rangeValue{_rangeValue}, stepValue{1} {};
Range(int _initValue, int _rangeValue, int _stepValue) : initValue{_initValue},
rangeValue{_rangeValue}, stepValue{_stepValue} {};
bool condition(); // should we iterate?
int next(); // the value to be assigned to the loop counter.
private:
int initValue, rangeValue, stepValue;
};
#endif //EXPRINTER_RANGE_H