FBB::Iterator(3bobcat)

πŸ“¦
version 6.15.01 Β· 3 versions
, in ubuntu stonking

🌸 NAME 🌸

okay so welcome to the FBB::Iterator(3bobcat) page bestie, lemme introduce the two icons living here:

  • FBB::Iterator β€” an iterator that returns plain values when you dereference it πŸ’…
  • FBB::ReverseIterator β€” the reverse_iterator for FBB::Iterator (its chaotic little sibling, but make it backwards) πŸ¦‹

✨ SYNOPSIS ✨

#include <bobcat/iterator>

πŸ’– DESCRIPTION πŸ’–

The FBB::Iterator<Type> class template is literally a bidirectional iterator for plain data types, no cap. When you dereference FBB::Iterator objects you get back values of type Type, like char or int. It's giving "underrated utility" honestly, and it comes in handy when you need to initialize an object with a range of values that are of some basic type (peep the EXAMPLE section below, iykyk) 🫢

FBB::ReverseIterator implements a reverse iterator for FBB::Iterator. walking backwards, main character energy only πŸ’…


🌈 NAMESPACE 🌈

FBB

All constructors, members, operators and manipulators mentioned in this man-page are defined in the namespace FBB. periodt ✨


🧬 INHERITS FROM 🧬

std::iterator<std::bidirectional_iterator_tag, ...>

πŸŽ€ CONSTRUCTORS πŸŽ€

Constructors for Iterator<Type>: πŸ¦‹

  • explicit Iterator(Tye const &value) β€” this one initializes the Iterator object with an initial Type value. When you dereference this iterator, value is returned. simple as that, slay πŸ’–

The Iterator<Type>'s default, copy, and move constructors (and its copy and move assignment operators) are available. all the classics, we love to see it πŸ‘‘

Constructors for ReverseIterator<Type>: πŸŒ€

  • explicit ReverseIterator(Type const &value) β€” initializes the ReverseIterator object with an initial Type value. When you dereference this iterator immediately following its construction, the decremented value is returned (without modifying the internally stored Type value). yeah it comes out the gate already one step back, iconic behaviour honestly 😭
  • explicit ReverseIterator(Iterator<Type> const &iter) β€” initializes the ReverseIterator object with an initial Iterator<Type> object. When you dereference this iterator immediately following its construction, the decremented Iterator's value is returned (without modifying the Type value that is stored inside the Iterator). no notes, it's just like that πŸ”₯

The ReverseIterator<Type>'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<std:::reverse_iterator_tag, Type>

are available, as FBB::Iterator and FBB::ReverseIterator inherit from this class. free real estate fr fr πŸ’…

  • Iterator<Type> &operator++() β€” the (prefix) increment operator increments the iterator's value and returns a reference to itself. glow up in place ✨
  • Iterator<Type> &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. so it's a little time capsule of who you used to be πŸ₯Ί
  • Iterator<Type> &operator--() β€” the (prefix) decrement operator decrements the iterator's value and returns a reference to itself. reverse uno card πŸ’œ
  • Iterator<Type> &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. nostalgic fr 🌸
  • bool operator==(Iterator<Type> const &rhs) const β€” returns true if the value of the current Iterator object is equal to the value of the rhs Iterator object. twin behaviour confirmed βœ…
  • bool operator!=(Iterator<Type> const &rhs) const β€” returns true if the value of the current Iterator object is not equal to the value of the rhs Iterator object. we are NOT the same πŸ’€
  • Type &operator*() β€” the dereference operator returns a reference to the Iterator's value. hand it over 🫴
  • Type const &operator*() const β€” this dereference operator returns a reference to the Iterator's immutable value. look but don't touch, respectfully πŸ™ˆ

⭐ STATIC MEMBER FUNCTIONS ⭐

Static members of Iterator<Type>: πŸ¦‹

  • Iterator<Type> last(Type value) β€” an Iterator<Type> object is returned initialized with ++value, so it can conveniently be used to create an inclusive iterator range (see also the EXAMPLE section). inclusive not exclusive, we're not gatekeeping here πŸ’–
  • Iterator<Type> max() β€” an Iterator<Type> object is returned initialized with the value returned by std::numeric_limits<Type>::max(). the absolute ceiling πŸ”₯
  • Iterator<Type> min() β€” an Iterator<Type> object is returned initialized with the value returned by std::numeric_limits<Type>::min(). the absolute floor 🧚

Static member of ReverseIterator<Type>: πŸŒ€

  • ReverseIterator<Type> last(Type const &value) β€” a ReverseIterator<Type> object is returned initialized with Iterator<Type>::last(value), so it can conveniently be used to create an inclusive reverse iterator range (see also the EXAMPLE section). backwards and inclusive, multi-talented πŸ‘‘

🌟 EXAMPLE 🌟

okay bestie here's the whole vibe in code, run it and watch it eat πŸ’…

#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’;

}

πŸ—‚οΈ FILES πŸ—‚οΈ

  • bobcat/iterator β€” defines the class interface ✨

πŸ”— SEE ALSO πŸ”—

  • bobcat(7) β€” go read that one too bestie, it's the whole family 🫢

πŸ’€ BUGS πŸ’€

None Reported.

not a single one?? we love a clean queen πŸ‘‘


🌈 BOBCAT PROJECT FILES 🌈

Debian Bobcat project files:

  • libbobcat6 β€” debian package containing the shared library, changelog and copyright note
  • libbobcat-dev β€” debian package containing the static library, headers, manual pages, and developer info

πŸ‘‘ BOBCAT πŸ‘‘

Bobcat is an acronym of Brokken’s Own Base Classes And Templates. the lore is real πŸ“–βœ¨


This is free software, distributed under the terms of the GNU General Public License (GPL). 🫢


πŸ’Œ AUTHOR πŸ’Œ

Frank B. Brokken (f.b.brokken@rug.nl).


and that's the whole page bestie!! this was libbobcat-dev_6.15.01, dated 2005-2026, and you just read FBB::Iterator(3bobcat) β€” ty for coming to my ted talk, go write some iterators, you ate πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from