#ifndef THIN_RANGE_H #define THIN_RANGE_H #include #include //---------------------------------------------------------------- namespace thin_provisioning { template class range { public: typedef boost::optional maybe; range(maybe begin = maybe(), maybe end = maybe()) : begin_(begin), end_(end) { } bool operator ==(range const &r) const { return (begin_ == r.begin_ && end_ == r.end_); } maybe begin_; maybe end_; }; template std::ostream & operator <<(std::ostream &out, range const &r) { if (r.begin_) out << "[" << *r.begin_; else out << "[-"; out << ", "; if (r.end_) out << *r.end_ << "]"; else out << "-]"; return out; } } //---------------------------------------------------------------- #endif