FBB::Iterator(3bobcat) Iterator returning plain values FBB::Iterator(3bobcat) NAME FBB::Iterator - Iterator returning plain values when dereferenced FBB::ReverseIterator - reverse_iterator for FBB::Iterator SYNOPSIS #include DESCRIPTION The FBB::Iterator class template implements a bidirectional iterator for plain data types. Dereferencing FBB::Iterator objects returns values of type Type, e.g., char or int. This iterator comes in handy in case you need to initialize an objects with a range of values, which are of some basic type (see also the EXAMPLE section). FBB::ReverseIterator implements a reverse iterator for FBB::Iterator. NAMESPACE FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM std::iterator CONSTRUCTORS Constructors for Iterator: o explicit Iterator(Tye const &value): This constructor initializes the Iterator object with an initial Type value. When dereferencing this iterator, value is returned. The Iterator's default, copy, and move constructors (and its copy and move assignment operators) are available. Constructors for ReverseIterator: o explicit ReverseIterator(Type const &value): This constructor initializes the ReverseIterator object with an initial Type value. When dereferencing this iterator immediately following its construction, the decremented value is returned (without modifying the internally stored Type value); o explicit ReverseIterator(Iterator const &iter): This constructor initializes the ReverseIterator object with an initial Iterator object. When dereferencing this iterator immediately following its construction, the decremented Iterator's value is returned (without modifying the Type value that is stored inside the Iterator). The ReverseIterator's default, copy, and move constructors (and its copy and move assignment operators) are available. MEMBER FUNCTIONS For template parameter type Type all members of std::iterator are available, as FBB::Iterator and FBB::ReverseIterator inherit from this class. o Iterator &operator++(): The (prefix) increment operator increments the iterator's value and returns a reference to itself; o Iterator &operator++(int): The (postfix) increment operator increments the iterator's value and returns a copy of itself, initialized with the iterator's value before it was incremented; o Iterator &operator--(): The (prefix) decrement operator decrements the iterator's value and returns a reference to itself; o Iterator &operator--(int): The (postfix) decrement operator decrements the iterator's value and returns a copy of itself, initialized with the iterator's value before it was decremented; o bool operator==(Iterator const &rhs) const: This operator returns true if the value of the current Iterator object is equal to the value of the rhs Iterator object; o bool operator!=(Iterator const &rhs) const: This operator returns true if the value of the current Iterator object is not equal to the value of the rhs Iterator object; o Type &operator*(): The derefence operator returns a reference to the Iterator's value. o Type const &operator*() const: This derefence operator returns a reference to the Iterator's immutable value. STATIC MEMBER FUNCTIONS Static members of Iterator: o Iterator last(Type value): An Iterator object is returned initialized with ++value, so it can be conveniently be used to create an inclusive iterator range (see also section EXAMPLE); o Iterator max(): An Iterator object is returned initialized with the value returned by std::numeric_limits::max(); o Iterator min(): An Iterator object is returned initialized with the value returned by std::numeric_limits::min() Static member of ReverseIterator: o ReverseIterator last(Type const &value): A ReverseIterator object is returned initialized with Iterator::last(value), so it can be conveniently be used to create an inclusive reverse iterator range (see also section EXAMPLE); EXAMPLE #include #include #include #include #include using namespace std; using namespace FBB; int main() { copy(Iterator(10), Iterator(20), ostream_iterator(cout, ", ")); cout << '\n'; copy(Iterator(*Iterator::max() - 9), Iterator::last(*Iterator::max()), ostream_iterator(cout, ", ")); cout << '\n'; cout << *Iterator::max() << '\n'; copy(Iterator(*Iterator::max() - 9), Iterator::last(*Iterator::max()), ostream_iterator(cout, ", ")); cout << '\n'; copy(ReverseIterator(20), ReverseIterator(10), ostream_iterator(cout, ", ")); cout << '\n'; std::string letters(Iterator('a'), Iterator::last('z')); cout << letters << '\n'; std::string caps(ReverseIterator::last('Z'), ReverseIterator('A')); cout << caps << '\n'; } FILES bobcat/iterator - defines the class interface SEE ALSO bobcat(7) BUGS None Reported. BOBCAT PROJECT FILES o https://fbb-git.gitlab.io/bobcat/: gitlab project page; o bobcat_6.06.02-x.dsc: detached signature; o bobcat_6.06.02-x.tar.gz: source archive; o bobcat_6.06.02-x_i386.changes: change log; o libbobcat1_6.06.02-x_*.deb: debian package containing the libraries; o libbobcat1-dev_6.06.02-x_*.deb: debian package containing the libraries, headers and manual pages; BOBCAT Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR Frank B. Brokken (f.b.brokken@rug.nl). libbobcat-dev_6.06.02 2005-2024 FBB::Iterator(3bobcat)