Class template discrete_interval

| Home | Libraries | People | FAQ | More

## Class template discrete_interval

boost::icl::discrete_interval

## Synopsis

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

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

      // construct/copy/destruct
      discrete_interval();
      discrete_interval(const DomainT &);
      discrete_interval(const DomainT &, const DomainT &,
                        interval_bounds = interval_bounds::right_open(),
                        discrete_interval * = 0);

      // public member functions
      domain_type lower() const;
      domain_type upper() const;
      interval_bounds bounds() const;

      // public static functions
      static discrete_interval open(const DomainT &, const DomainT &);
      static discrete_interval right_open(const DomainT &, const DomainT &);
      static discrete_interval left_open(const DomainT &, const DomainT &);
      static discrete_interval closed(const DomainT &, const DomainT &);
    };

## Description

### `discrete_interval` public construct/copy/destruct

1.     discrete_interval();

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

2.     discrete_interval(const DomainT & val);

   Constructor for a closed singleton interval `[val,val]`

3.     discrete_interval(const DomainT & low, const DomainT & up,
                         interval_bounds bounds = interval_bounds::right_open(),
                         discrete_interval * = 0);

   Interval from `low` to `up` with bounds `bounds`

### `discrete_interval` public member functions

1.     domain_type lower() const;

2.     domain_type upper() const;

3.     interval_bounds bounds() const;

### `discrete_interval` public static functions

1.     static discrete_interval open(const DomainT & lo, const DomainT & up);

2.     static discrete_interval right_open(const DomainT & lo, const DomainT & up);

3.     static discrete_interval left_open(const DomainT & lo, const DomainT & up);

4.     static discrete_interval closed(const DomainT & lo, const DomainT & up);