FBB::Hash(3bobcat)

πŸ’– FBB::Hash πŸ’– β€” the bobcat manual, section 3 (3bobcat), bestie edition πŸ¦‹

okay so sit down, grab a strawberry πŸ“, because we're talking about FBB::Hash β€” the hashing container glow-up from the bobcat library. it's giving template magic, it's giving group chat energy, and yes it ate. πŸ’…


✨ NAME ✨

FBB::Hash β€” various mapping template classes using hashing πŸŽ€


✨ SYNOPSIS ✨

#include <bobcat/hash>

✨ DESCRIPTION ✨

so the FBB:Hash squad of template classes is all about hashing-based mapping, okurrr? there are a bunch of variants, and every single one of them is built on top of the facilities that unordered_map offers. no cap. πŸ”₯

here's the tea though: the hash-map situation in the unordered_map container has a fairly complex construction interface 😭, and Hash is literally the attempt to simplify that part of the interface. icon behavior honestly.

in practice, hashing uses a textual key, which may be std::string based or char * based, and the keys can be used either case sensitively or case insensitively. and Hash is out here asking for the bare minimum from you: just specify the map's value type. that's it bestie. the key may be a char const * or a std::string, used case sensitively or case insensitively, and Hash handles the vibe check for you. 🌈


✨ NAMESPACE ✨

FBB

literally every constructor, member, operator and manipulator mentioned in this man-page is defined in the namespace FBB. all of them. periodt. πŸ‘‘


✨ INHERITS FROM ✨

std::unordered_map, using various instantiations. yes she's a nepo baby and we love her for it. πŸ’œ


✨ TYPE ✨

every variant defines value_type as the corresponding unordered_map value_type. in practice a value_type defines a std::pair<Key, Value>, where Key represents the hash's key-type and Value represents the hash's value type. so like... a little couple. a duo. main character and their partner. 🫢


✨ CONSTRUCTORS ✨

variants of the FBB::Hash container are available for char const * keys or std::string keys, used case sensitively or case insensitively. four flavors, pick your fighter. 🧚

and listen β€” all variants support:

  • default construction ✨
  • move construction (plus move assignment, obviously) πŸ’…
  • construction from initializer lists πŸŽ€
  • construction from iterators defining a half-open range of value_type values 🌸

okay so here are the variants, showing their default constructors. Value refers to the value type stored in the hash table, iykyk:

  • HashCharPtr<Value>() β€” this hash table uses case sensitive char const * keys πŸ”₯
  • HashCharCasePtr<Value>() β€” this hash table uses case insensitive char const * keys 🌈
  • HashString<Value>() β€” this hash table uses case sensitive std::string keys ⭐
  • HashStringCase<Value>() β€” this hash table uses case insensitive std::string keys πŸ’–

✨ OVERLOADED OPERATOR ✨

on top of the index operator inherited from unordered_map, the overloaded copy and move assignment operators are available for all Hash containers. so you can = to your heart's content. no thoughts, just assignment. πŸ™ˆ


✨ MEMBER FUNCTIONS ✨

every single member of the unordered_map container is available, because Hash inherits from this template class. the whole inheritance bag, bestie. πŸ’€


✨ EXAMPLE ✨

look at her go:

#include <iostream>
#include <bobcat/hash>

using namespace std;
using namespace FBB;

pair<char const *, size_t> ap[] =
{
    pair<char const *, size_t>("one", 1),
    pair<char const *, size_t>("two", 2),
};

int main()
{
    HashCharPtr<size_t> hcp;
    HashCharPtr<size_t> hcp2(ap, ap + 2);
    HashCharPtr<size_t> hcp3(hcp2);

    hcp = hcp2;

    cout << hcp2["one"] << endl;
}

like?? default construct, iterator-range construct, copy construct, copy assign, and then hcp2["one"] goes brrr. slay. πŸ”₯


✨ FILES ✨

  • bobcat/hash β€” defines the class interface πŸŽ€

✨ SEE ALSO ✨


✨ BUGS ✨

None Reported. (a clean queen. not a single problem reported. we stan. πŸ‘‘)


✨ 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. like, the name itself is a flex. πŸ’…


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


✨ AUTHOR ✨

Frank B. Brokken (f.b.brokken@rug.nl). the man, the myth, the maintainer. πŸ™Œ


okay so that's the whole page, every single detail intact, nothing skipped, no cap πŸ’–

and that's a wrap on libbobcat-dev_6.15.01, dated 2005-2026 β€” the FBB::Hash manual page, section 3bobcat, signed off with love for the bobcat library. go forth and hash responsibly, bestie πŸŒˆπŸ’…βœ¨

πŸ“¦ where this page comes from