Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.

Class template closed_interval



// In header: <boost/icl/closed_interval.hpp>

template<typename DomainT, 
         ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, DomainT)> 
class closed_interval {
  // types
  typedef closed_interval< DomainT, Compare > type;       
  typedef DomainT                             domain_type;

  // construct/copy/destruct
  explicit closed_interval(const DomainT &);
  closed_interval(const DomainT &, const DomainT &);

  // public member functions
  DomainT lower() const;
  DomainT upper() const;
  DomainT first() const;
  DomainT last() const;


closed_interval public construct/copy/destruct

  1. closed_interval();

    Default constructor; yields an empty interval [0,0).

  2. explicit closed_interval(const DomainT & val);

    Constructor for a closed singleton interval [val,val]

  3. closed_interval(const DomainT & low, const DomainT & up);

    Interval from low to up with bounds bounds

closed_interval public member functions

  1. DomainT lower() const;
  2. DomainT upper() const;
  3. DomainT first() const;
  4. DomainT last() const;