I'm having some trouble with a program I'm writing involving the construction of a class. The class includes a vector whose type is of another class. There are two separate classes, Interval (which holds a low and a high value) and IntervalSet (which holds the vector of Intervals). I'm very lost as to how I have to word the constructor in both the .cpp and header files.
- Since you're using private members, you should also define your setters and getters for 'Interval'
- //Construct a new interval with the indicated bounds -if this is your directive then it probably means that your constructor needs a default value for low and high :?
- as for 'IntervalSet', I'm sorry I can't comment more -if you only need a vector of Intervals then std::vector<Interval> intervalList(10); is probably enough
-
I'm very lost as to how I have to word the constructor in both the .cpp and header files.