STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

integral_range Class Template Reference
[Range Classes]

This range class represents an integral range. More...

#include <integral_range.hpp>

Inheritance diagram for integral_range:

notional_range_tag List of all members.

Notional Range methods

ss_bool_t is_open () const
 Indicates whether the range is open.

value_type current () const
 Returns the current value in the range.

class_type & advance ()
 Advances the current position in the range.

 operator operator_bool_type () const
 Indicates whether the range is open.

value_type operator * () const
 Returns the current value in the range.

class_type & operator++ ()
 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 Methods

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 ()
 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.


Detailed Description

template<typename T, typename XP = null_exception_policy>
class stlsoft::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);
    


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   [inline]
 

Destructor.


Member Function Documentation

class_type& advance   [inline]
 

Advances the current position in the range.

value_type current   const [inline]
 

Returns the current value in the range.

ss_bool_t is_open   const [inline]
 

Indicates whether the range is open.

value_type operator *   const [inline]
 

Returns the current value in the range.

operator operator_bool_type   const [inline]
 

Indicates whether the range is open.

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

Evaluates whether two ranges are unequal.

class_type operator++ int    [inline]
 

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

class_type& operator++   [inline]
 

Advances the current position in the range.

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

Evaluates whether two ranges are equal.


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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004