17 #ifndef HLIDAC_PES_INTERVAL_H
18 #define HLIDAC_PES_INTERVAL_H
53 throw std::invalid_argument(
"Interval<T>::Interval(T f, T t): Invalid range!");
56 T from()
const {
return mFrom; }
57 T to()
const {
return mTo; }
67 friend std::istream& operator>> <>(std::istream&,
Interval<T>&);
78 if ((in.fail() && !in.eof()) || t.
mFrom > t.
mTo)
79 throw std::invalid_argument(
"istream& operator>>(istream&, Interval<T>&): Invalid range!");
89 std::ostream& operator<<(std::ostream& out, const Interval<T>& t) {
90 out<<
"<"<<t.from()<<
","<<t.to()<<
">";
Interval(T f, T t)
It constructs the interval [f,t] from two endpoint values.
T mFrom
The left endpoint of the interval.
The template class for intervals.
Interval()
Default constructor creates an empty interval.
T mTo
The right endpoint of the interval.
std::istream & operator>>(std::istream &, Interval< T > &)
Overloading of the input operator for the Interval class.