Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Namespaces | Functions
Saf/Algo/Range.h File Reference

Algorithms and functions that execute on a range of elements.
More...

#include "../Type.h"
#include "../Type/IteratorTraits.h"
#include "../IndexOutOfRangeException.h"

Go to the source code of this file.

Namespaces

namespace  Saf
 Global library namespace.
namespace  Saf::Algo
 Generic data handling algorithms and structures.
namespace  Saf::Algo::Range
 Algorithms and functions that execute on a range of elements.

Functions

template<class Iter >
void Saf::Algo::Range::Advance (Iter &it, Size dist)
 Move an iterator by a specified distance.
template<class FwdIter , class Val >
bool Saf::Algo::Range::AllEqualTo (FwdIter begin, FwdIter end, const Val &val)
 Check whether all elements in the range [begin, end) are equal to val.
template<class FwdIter , class Val >
bool Saf::Algo::Range::AnyEqualTo (FwdIter begin, FwdIter end, const Val &val)
 Check whether any of the elements in the range [begin, end) is equal to val.
template<class FwdIterIn , class FwdIterOut >
FwdIterOut Saf::Algo::Range::Copy (FwdIterIn begin, FwdIterIn end, FwdIterOut dest)
 Copy values from the range [begin, end) to the sequence starting with dest.
template<class FwdIter , class Val >
Size Saf::Algo::Range::Count (FwdIter begin, FwdIter end, const Val &val)
 Count elements with value val in the sequence [begin, end).
template<class FwdIter , class Pred >
Size Saf::Algo::Range::CountIf (FwdIter begin, FwdIter end, Pred pred)
 Count elements in the sequence [begin, end) for which the predicate pred holds.
template<class Iter >
Size Saf::Algo::Range::Distance (Iter begin, Iter end)
 Calculate the number of elements in the range [begin, end).
template<class FwdIter1 , class FwdIter2 >
bool Saf::Algo::Range::Equal (FwdIter1 r1Begin, FwdIter1 r1End, FwdIter2 r2Begin)
 Check whether two ranges of the same length contain the same values.
template<class FwdIter , class Val >
void Saf::Algo::Range::Fill (FwdIter begin, FwdIter end, const Val &val)
 Assign value val to all elements in the range [begin, end).
template<class FwdIter , class Val >
void Saf::Algo::Range::FillFirst (FwdIter first, Size num, const Val &val)
 Assign value val to first num elements in the sequence starting with first.
template<class FwdIter , class Func >
Func Saf::Algo::Range::ForEach (FwdIter begin, FwdIter end, Func func)
 Apply functor func to all elements in the range [begin, end).
template<class FwdIter1 , class FwdIter2 >
bool Saf::Algo::Range::Identical (FwdIter1 r1Begin, FwdIter1 r1End, FwdIter2 r2Begin, FwdIter2 r2End)
 Check whether two ranges have the same length and contain the same values.
template<class BidIter >
void Saf::Algo::Range::Reverse (BidIter begin, BidIter end)
 Reverse the values in the range [begin,end).
template<class Iter >
void Saf::Algo::Range::Rotate (Iter begin, Iter middle, Iter end)
 Rotate the elements in the range [begin, end) such that the element pointed to by middle is first.

Detailed Description

Algorithms and functions that execute on a range of elements.
Author:
Ondrej Danek ondre.nosp@m.j.da.nosp@m.nek@g.nosp@m.mail.nosp@m..com
Date:
2011