integral_range Class Template Reference

#include <rangelib/integral_range.hpp>

Inheritance diagram for integral_range:

notional_range_tag

List of all members.


Detailed Description

template<typename T, typename XP = invalid_integral_range_policy>
class rangelib::integral_range< T, XP >

This range class represents an integral range.

It is categoried as a Notional Range

It could be used as follows

  // Create a range of integer values, in the range [-100, 200), in increments of 5
  stlsoft::integral_range<int>   r(-100, +100, 5);

  // Calculate the total
  int total = stlsoft::r_accumulate(r, 0);

Notional Range methods

bool is_open () const
 Indicates whether the range is open.
const_reference current () const
 Returns the current value in the range.
class_typeadvance ()
 Advances the current position in the range.
 operator operator_bool_type () const
 Indicates whether the range is open.
const_reference operator* () const
 Returns the current value in the range.
class_typeoperator++ ()
 Advances the current position in the range.
class_type operator++ (int)
 Advances the current position in the range, returning a copy of the range prior to its being advanced.

Public Types

Types
typedef T value_type
typedef T const & const_reference
typedef XP exception_policy_type
typedef notional_range_tag range_tag_type
typedef integral_range< T, XP > class_type

Public Member Functions

Construction
 integral_range (value_type first, value_type last, value_type increment=+1)
 Constructs from a start and end position, and an increment.
 ~integral_range () throw ()
 Destructor.
Comparison
bool operator== (class_type const &rhs) const
 Evaluates whether two ranges are equal.
bool operator!= (class_type const &rhs) const
 Evaluates whether two ranges are unequal.

Constructor & Destructor Documentation

integral_range ( value_type  first,
value_type  last,
value_type  increment = +1 
) [inline]

Constructs from a start and end position, and an increment.

~integral_range (  )  throw () [inline]

Destructor.

References STLSOFT_STATIC_ASSERT.


Member Function Documentation

bool is_open (  )  const [inline]

Indicates whether the range is open.

const_reference current (  )  const [inline]

Returns the current value in the range.

References STLSOFT_MESSAGE_ASSERT.

class_type& advance (  )  [inline]

Advances the current position in the range.

References STLSOFT_MESSAGE_ASSERT.

operator operator_bool_type (  )  const [inline]

Indicates whether the range is open.

const_reference operator* (  )  const [inline]

Returns the current value in the range.

class_type& operator++ (  )  [inline]

Advances the current position in the range.

class_type operator++ ( int   )  [inline]

Advances the current position in the range, returning a copy of the range prior to its being advanced.

bool operator== ( class_type const &  rhs  )  const [inline]

Evaluates whether two ranges are equal.

References integral_range::m_last, integral_range::m_position, and STLSOFT_MESSAGE_ASSERT.

bool operator!= ( class_type const &  rhs  )  const [inline]

Evaluates whether two ranges are unequal.


The documentation for this class was generated from the following file:

Generated on Thu Jun 10 08:58:33 2010 for STLSoft by  doxygen 1.5.6