| FBB::Iterator(3bobcat) | Iterator returning plain values | FBB::Iterator(3bobcat) |
FBB::Iterator - Iterator returning plain values when dereferenced
FBB::ReverseIterator - reverse_iterator for FBB::Iterator
#include <bobcat/iterator>
The FBB::Iterator<Type> 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.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
std::iterator<std::bidirectional_iterator_tag, ...>
Constructors for Iterator<Type>:
The Iterator<Type>’s default, copy, and move constructors (and its copy and move assignment operators) are available.
Constructors for ReverseIterator<Type>:
The ReverseIterator<Type>’s default, copy, and move constructors (and its copy and move assignment operators) are available.
For template parameter type Type all members of std::iterator<std:::reverse_iterator_tag, Type> are available, as FBB::Iterator and FBB::ReverseIterator inherit from this class.
Static members of Iterator<Type>:
Static member of ReverseIterator<Type>:
#include <algorithm>
#include <iterator>
#include <iostream>
#include <string>
#include <bobcat/iterator>
using namespace std;
using namespace FBB;
int main()
{
copy(Iterator<int>(10), Iterator<int>(20),
ostream_iterator<int>(cout, ", "));
cout << ’\n’;
copy(Iterator<char>(*Iterator<char>::max() - 9),
Iterator<char>::last(*Iterator<char>::max()),
ostream_iterator<int>(cout, ", "));
cout << ’\n’;
cout << *Iterator<int>::max() << ’\n’;
copy(Iterator<int>(*Iterator<int>::max() - 9),
Iterator<int>::last(*Iterator<int>::max()),
ostream_iterator<int>(cout, ", "));
cout << ’\n’;
copy(ReverseIterator<int>(20), ReverseIterator<int>(10),
ostream_iterator<int>(cout, ", "));
cout << ’\n’;
std::string letters(Iterator<char>(’a’), Iterator<char>::last(’z’));
cout << letters << ’\n’;
std::string caps(ReverseIterator<char>::last(’Z’),
ReverseIterator<char>(’A’));
cout << caps << ’\n’;
}
bobcat/iterator - defines the class interface
None Reported.
Debian Bobcat project files:
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
| 2005-2025 | libbobcat-dev_6.07.01 |