...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::icl::closed_interval
// In header: <boost/icl/closed_interval.hpp> template<typename DomainT, ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, DomainT)> class closed_interval { public: // types typedef closed_interval< DomainT, Compare > type; typedef DomainT domain_type; // construct/copy/destruct closed_interval(); explicit closed_interval(const DomainT &); closed_interval(const DomainT &, const DomainT &); // public member functions typedef ICL_COMPARE_DOMAIN(Compare, DomainT); DomainT lower() const; DomainT upper() const; DomainT first() const; DomainT last() const; };