Boost C++ Libraries

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

PrevUpHomeNext

Class template closed_interval

boost::icl::closed_interval

Synopsis

// 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;

  // public member functions
  typedef ICL_COMPARE_DOMAIN(Compare, DomainT);
  closed_interval();
  explicit closed_interval(const DomainT &);
  closed_interval(const DomainT &, const DomainT &);
  DomainT lower() const;
  DomainT upper() const;
  DomainT first() const;
  DomainT last() const;
};

Description

closed_interval public member functions

  1. typedef ICL_COMPARE_DOMAIN(Compare, DomainT);
  2. closed_interval();

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

  3. explicit closed_interval(const DomainT & val);

    Constructor for a closed singleton interval [val,val]

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

    Interval from low to up with bounds bounds

  5. DomainT lower() const;
  6. DomainT upper() const;
  7. DomainT first() const;
  8. DomainT last() const;

PrevUpHomeNext