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  

Range Algorithms
[RangeLib]

Range algorithms. More...

Functions

template<typename R, typename T> T r_accumulate (R r, T val)
 accumulate() for ranges

template<typename R, typename T, typename P> T r_accumulate (R r, T val, P pr)
 accumulate() for ranges

template<typename R, typename O> O r_copy (R r, O o)
 Copies the contents of the range to the output iterator.

template<typename R, typename T> ss_size_t r_count (R r, const T &val)
 Counts the number of instances of a given value in the range.

template<typename R, typename P> ss_size_t r_count_if (R r, P pr)
 Counts the number of instances matching the given predicate in the range.

template<typename R> ss_ptrdiff_t r_distance (R r)
 Counts the number of instances in the range.

template<typename R1, typename R2> ss_bool_t r_equal (R1 r1, R2 r2)
 Determines whether two ranges are equal.

template<typename R1, typename R2, typename P> ss_bool_t r_equal (R1 r1, R2 r2, P pr)
 Determines whether two ranges are equal, as defined by a predicate.

template<typename R, typename T> R r_exists (R r, T const &val)
 Determines whether the given value exists in the range.

template<typename R, typename P> R r_exists_if (R r, P pr)
 Determines whether a value matching the given predicate exists in the range.

template<typename R, typename P, typename T> R r_exists_if (R r, P pr, T &result)
 Determines whether a value matching the given predicate exists in the range.

template<typename R, typename T> void r_fill (R r, const T &val)
 Sets the elements in the range to the given value.

template<typename R, typename S, typename T> void r_fill_n (R r, S n, T const &val)
 Sets the first n elements in the range to the given value.

template<typename R, typename T> R r_find (R r, T const &val)
 Finds the first instance of the given value in the range.

template<typename R, typename P> R r_find (R r, P pr)
 Finds the first instance of a value in the range matching the given predicate.

template<typename R, typename F> F r_for_each (R r, F f)
 Applies the given function to every element in the range.

template<typename R, typename F> void r_generate (R r, F f)
 Sets each element in the range to the result of the given function.

template<typename R> R::value_type r_max_element (R r)
 Evaluates the maximum element in the range.

template<typename R, typename F> R::value_type r_max_element (R r, F f)
 Evaluates the maximum element in the range evaluated according to the given function.

template<typename R> R::value_type r_min_element (R r)
 Evaluates the minimum element in the range.

template<typename R, typename F> R::value_type r_min_element (R r, F f)
 Evaluates the minimum element in the range evaluated according to the given function.

template<typename R, typename T> void r_replace (R r, T oldVal, T newVal)
 Replaces all elements of the given old value with the new value.

template<typename R, typename P, typename T> void r_replace_if (R r, P pr, T newVal)
 Replaces all elements matching the given predicate with the new value.


Detailed Description

Range algorithms.


Function Documentation

T r_accumulate   r,
  val,
  pr
[inline]
 

accumulate() for ranges

Parameters:
r  The range
val  The initial value
pr  The predicate applied to each entry
Return values:
The  sum of the accumulate items and the initial value
\note: Supports Notional, Iterable and Indirect Range types

T r_accumulate   r,
  val
[inline]
 

accumulate() for ranges

Parameters:
r  The range
val  The initial value
Return values:
The  sum of the accumulate items and the initial value
\note: Supports Notional, Iterable and Indirect Range types

O r_copy   r,
  o
[inline]
 

Copies the contents of the range to the output iterator.

Parameters:
r  The range whose elements are to be copied
o  The output iterator to receive the elements
\note: Supports Notional, Iterable and Indirect Range types

ss_size_t r_count   r,
const T &    val
[inline]
 

Counts the number of instances of a given value in the range.

Parameters:
r  The range
val  The value to search for
Return values:
The  number of elements in the range matching val
\note: Supports Notional, Iterable and Indirect Range types

ss_size_t r_count_if   r,
  pr
[inline]
 

Counts the number of instances matching the given predicate in the range.

Parameters:
r  The range
pr  The predicate applied to each entry
Return values:
The  number of elements in the range matching val
\note: Supports Notional, Iterable and Indirect Range types

ss_ptrdiff_t r_distance   r [inline]
 

Counts the number of instances in the range.

Parameters:
r  The range
Return values:
The  number of elements in the range
\note: Supports Notional, Iterable and Indirect Range types

ss_bool_t r_equal R1    r1,
R2    r2,
  pr
[inline]
 

Determines whether two ranges are equal, as defined by a predicate.

Parameters:
r1  The first range to compare
r2  The second range to compare
pr  The predicate which evaluates matches between elements of the two ranges
Return values:
true  if the first N elements in the second range match the N elements in the first range.
\note: Supports Notional and Iterable Range types

ss_bool_t r_equal R1    r1,
R2    r2
[inline]
 

Determines whether two ranges are equal.

Parameters:
r1  The first range to compare
r2  The second range to compare
Return values:
true  if the first N elements in the second range match the N elements in the first range.
\note: Supports Notional and Iterable Range types

R r_exists   r,
T const &    val
[inline]
 

Determines whether the given value exists in the range.

Parameters:
r  The range
val  The value to search for
\note: Supports Notional, Iterable and Indirect Range types

R r_exists_if   r,
  pr,
T &    result
[inline]
 

Determines whether a value matching the given predicate exists in the range.

Parameters:
r  The range
pr  The predicate used to match the items
\note: Supports Notional, Iterable and Indirect Range types

R r_exists_if   r,
  pr
[inline]
 

Determines whether a value matching the given predicate exists in the range.

Parameters:
r  The range
pr  The predicate used to match the items
\note: Supports Notional, Iterable and Indirect Range types

void r_fill   r,
const T &    val
[inline]
 

Sets the elements in the range to the given value.

Parameters:
r  The range
val  The value to assign to all elements in the range
\note: Supports Iterable Range type

void r_fill_n   r,
  n,
T const &    val
[inline]
 

Sets the first n elements in the range to the given value.

Parameters:
r  The range
n  The number of elements to set. This must be <font class = "code"><= r_distance(r)</font>
val  The value to assign to all elements in the range
\note: Supports Iterable Range type

R r_find   r,
  pr
[inline]
 

Finds the first instance of a value in the range matching the given predicate.

Parameters:
r  The range
pr  The value to find
\note: Supports Notional and Iterable Range types

R r_find   r,
T const &    val
[inline]
 

Finds the first instance of the given value in the range.

Parameters:
r  The range
val  The value to find
\note: Supports Notional and Iterable Range types

F r_for_each   r,
  f
[inline]
 

Applies the given function to every element in the range.

Parameters:
r  The range
f  The function to apply
\note: Supports Notional, Iterable and Indirect Range types

void r_generate   r,
  f
[inline]
 

Sets each element in the range to the result of the given function.

Parameters:
r  The range
f  The generator function
\note: Supports Iterable Range type

R::value_type r_max_element   r,
  f
[inline]
 

Evaluates the maximum element in the range evaluated according to the given function.

Parameters:
r  The range. Cannot be closed
f  The function used to evaluate the ordering
\note: Supports Notional, Iterable and Indirect Range types \note: The behaviour is undefined if the range is closed

R::value_type r_max_element   r [inline]
 

Evaluates the maximum element in the range.

Parameters:
r  The range. Cannot be closed
\note: Supports Notional, Iterable and Indirect Range types \note: The behaviour is undefined if the range is closed

R::value_type r_min_element   r,
  f
[inline]
 

Evaluates the minimum element in the range evaluated according to the given function.

Parameters:
r  The range. Cannot be closed
f  The function used to evaluate the ordering
\note: Supports Notional, Iterable and Indirect Range types \note: The behaviour is undefined if the range is closed

R::value_type r_min_element   r [inline]
 

Evaluates the minimum element in the range.

Parameters:
r  The range. Cannot be closed
\note: Supports Notional, Iterable and Indirect Range types \note: The behaviour is undefined if the range is closed

void r_replace   r,
  oldVal,
  newVal
[inline]
 

Replaces all elements of the given old value with the new value.

Parameters:
r  The range
oldVal  The value to search for
newVal  The value to replace any elements with oldVal
\note: Supports Iterable and Indirect Range types

void r_replace_if   r,
  pr,
  newVal
[inline]
 

Replaces all elements matching the given predicate with the new value.

Parameters:
r  The range
pr  The predicate for matching the old values to replace
newVal  The value to replace any elements which match the given predicate
\note: Supports Iterable and Indirect Range types

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