|
Simple Application Framework
1
|
Algorithms and functions that execute on a range of elements. More...
Functions | |
| template<class Iter > | |
| void | Advance (Iter &it, Size dist) |
| Move an iterator by a specified distance. | |
| template<class FwdIter , class Val > | |
| bool | 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 | 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 | 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 | Count (FwdIter begin, FwdIter end, const Val &val) |
Count elements with value val in the sequence [begin, end). | |
| template<class FwdIter , class Pred > | |
| Size | CountIf (FwdIter begin, FwdIter end, Pred pred) |
Count elements in the sequence [begin, end) for which the predicate pred holds. | |
| template<class Iter > | |
| Size | Distance (Iter begin, Iter end) |
Calculate the number of elements in the range [begin, end). | |
| template<class FwdIter1 , class FwdIter2 > | |
| bool | 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 | 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 | 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 | ForEach (FwdIter begin, FwdIter end, Func func) |
Apply functor func to all elements in the range [begin, end). | |
| template<class FwdIter1 , class FwdIter2 > | |
| bool | 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 | Reverse (BidIter begin, BidIter end) |
Reverse the values in the range [begin,end). | |
| template<class Iter > | |
| void | 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. | |
Algorithms and functions that execute on a range of elements.
| void Saf::Algo::Range::Advance | ( | Iter & | it, |
| Size | dist | ||
| ) | [inline] |
Move an iterator by a specified distance.
Properties:
for random-access iterators,
otherwise. | bool Saf::Algo::Range::AllEqualTo | ( | FwdIter | begin, |
| FwdIter | end, | ||
| const Val & | val | ||
| ) | [inline] |
Check whether all elements in the range [begin, end) are equal to val.
Properties:
. | bool Saf::Algo::Range::AnyEqualTo | ( | FwdIter | begin, |
| FwdIter | end, | ||
| const Val & | val | ||
| ) | [inline] |
Check whether any of the elements in the range [begin, end) is equal to val.
Properties:
. | FwdIterOut Saf::Algo::Range::Copy | ( | FwdIterIn | begin, |
| FwdIterIn | end, | ||
| FwdIterOut | dest | ||
| ) | [inline] |
Copy values from the range [begin, end) to the sequence starting with dest.
Properties:
.| Size Saf::Algo::Range::Count | ( | FwdIter | begin, |
| FwdIter | end, | ||
| const Val & | val | ||
| ) | [inline] |
Count elements with value val in the sequence [begin, end).
Properties:
. | Size Saf::Algo::Range::CountIf | ( | FwdIter | begin, |
| FwdIter | end, | ||
| Pred | pred | ||
| ) | [inline] |
Count elements in the sequence [begin, end) for which the predicate pred holds.
Properties:
. | Size Saf::Algo::Range::Distance | ( | Iter | begin, |
| Iter | end | ||
| ) | [inline] |
Calculate the number of elements in the range [begin, end).
Properties:
for random-access iterators, linear in the length of the sequence otherwise. | bool Saf::Algo::Range::Equal | ( | FwdIter1 | r1Begin, |
| FwdIter1 | r1End, | ||
| FwdIter2 | r2Begin | ||
| ) | [inline] |
Check whether two ranges of the same length contain the same values.
Properties:
.| [in] | r1Begin | Iterator to the beginning of the first sequence. |
| [in] | r1End | Iterator to the end of the first sequence. |
| [in] | r2Begin | Iterator to the beginning of the second sequence. The sequence must have the same length as the first one. |
| void Saf::Algo::Range::Fill | ( | FwdIter | begin, |
| FwdIter | end, | ||
| const Val & | val | ||
| ) | [inline] |
Assign value val to all elements in the range [begin, end).
Properties:
. | void Saf::Algo::Range::FillFirst | ( | FwdIter | first, |
| Size | num, | ||
| const Val & | val | ||
| ) | [inline] |
Assign value val to first num elements in the sequence starting with first.
Properties:
. | Func Saf::Algo::Range::ForEach | ( | FwdIter | begin, |
| FwdIter | end, | ||
| Func | func | ||
| ) | [inline] |
Apply functor func to all elements in the range [begin, end).
Properties:
. | bool Saf::Algo::Range::Identical | ( | FwdIter1 | r1Begin, |
| FwdIter1 | r1End, | ||
| FwdIter2 | r2Begin, | ||
| FwdIter2 | r2End | ||
| ) | [inline] |
Check whether two ranges have the same length and contain the same values.
Properties:
.| [in] | r1Begin | Iterator to the beginning of the first sequence. |
| [in] | r1End | Iterator to the end of the first sequence. |
| [in] | r2Begin | Iterator to the beginning of the second sequence. |
| [in] | r2End | Iterator to the end of the second sequence. |
| void Saf::Algo::Range::Reverse | ( | BidIter | begin, |
| BidIter | end | ||
| ) | [inline] |
Reverse the values in the range [begin,end).
Properties:
. | void Saf::Algo::Range::Rotate | ( | Iter | begin, |
| Iter | middle, | ||
| Iter | end | ||
| ) | [inline] |
Rotate the elements in the range [begin, end) such that the element pointed to by middle is first.
Properties:
.
1.8.0