Add a range class
This commit is contained in:
parent
6422b22610
commit
524f9474cf
26
thin-provisioning/range.h
Normal file
26
thin-provisioning/range.h
Normal file
@ -0,0 +1,26 @@
|
||||
#ifndef THIN_RANGE_H
|
||||
#define THIN_RANGE_H
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
namespace thin_provisioning {
|
||||
template <typename T>
|
||||
class range {
|
||||
public:
|
||||
typedef boost::optional<T> maybe;
|
||||
|
||||
range(maybe begin = maybe(), maybe end = maybe())
|
||||
: begin_(begin),
|
||||
end_(end) {
|
||||
}
|
||||
|
||||
maybe begin_;
|
||||
maybe end_;
|
||||
};
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user