__GNU_CXX::HASH_SET(3)

πŸ’– __gnu_cxx::hash_set< _Value, _HashFcn, _EqualKey, _Alloc > πŸ’–

okay bestie, welcome to the Library Functions Manual, section 3 β€” this is the libstdc++ corner of the universe, and today's main character is a class that is, and I quote, an SGI extension. Buckle up, it's giving retro-but-make-it-cute. πŸ¦‹


✨ NAME ✨

__gnu_cxx::hash_set< _Value, _HashFcn, _EqualKey, _Alloc > β€” yeah that's the whole name, it's a mouthful, I know, but she's iconic and she's a hash set. πŸ’…


🌸 SYNOPSIS 🌸

First things first, no cap:

#include <hash_set>

🌈 Public Types

These are the type aliases she's serving, verbatim, don't touch:

typedef _Ht::allocator_type allocator_type
typedef _Ht::const_iterator const_iterator
typedef _Alloc_traits::const_pointer const_pointer
typedef _Alloc_traits::const_reference const_reference
typedef _Ht::difference_type difference_type
typedef _Ht::hasher hasher
typedef _Ht::const_iterator iterator
typedef _Ht::key_equal key_equal
typedef _Ht::key_type key_type
typedef _Alloc_traits::pointer pointer
typedef _Alloc_traits::reference reference
typedef _Ht::size_type size_type
typedef _Ht::value_type value_type
bestie, look at how iterator is declared: typedef _Ht::const_iterator iterator. Yeah. That's what it says. πŸ‘€

πŸ’… Public Member Functions

The whole roster, exactly as she comes, nothing cut:

template<class _InputIterator> hash_set (_InputIterator __f, _InputIterator __l)
template<class _InputIterator> hash_set (_InputIterator __f, _InputIterator __l, size_type __n)
template<class _InputIterator> hash_set (_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf)
template<class _InputIterator> hash_set (_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
hash_set (size_type __n)
hash_set (size_type __n, const hasher &__hf)
hash_set (size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
iterator begin () const
size_type bucket_count () const
void clear ()
size_type count (const key_type &__key) const
size_type elems_in_bucket (size_type __n) const
bool empty () const
iterator end () const
pair< iterator, iterator > equal_range (const key_type &__key) const
size_type erase (const key_type &__key)
void erase (iterator __f, iterator __l)
void erase (iterator __it)
iterator find (const key_type &__key) const
allocator_type get_allocator () const
hasher hash_funct () const
template<class _InputIterator> void insert (_InputIterator __f, _InputIterator __l)
pair< iterator, bool > insert (const value_type &__obj)
pair< iterator, bool > insert_noresize (const value_type &__obj)
key_equal key_eq () const
size_type max_bucket_count () const
size_type max_size () const
void resize (size_type __hint)
size_type size () const
void swap (hash_set &__hs)

🫢 Friends

Exactly one (1) friend, and she returns a bool:

template<class _Val, class _HF, class _EqK, class _Al> bool operator== (const hash_set< _Val, _HF, _EqK, _Al > &, const hash_set< _Val, _HF, _EqK, _Al > &)

πŸ¦‹ Detailed Description πŸ¦‹

Here's the actual shape of the class, template params and all:

template<class _Value, class _HashFcn = hash<_Value>, class _EqualKey = equal_to<_Value>, class _Alloc = allocator<_Value>>
class __gnu_cxx::hash_set< _Value, _HashFcn, _EqualKey, _Alloc >

And then the lore, fr fr:

This is an SGI extension.

πŸ“Œ Todo

Needs documentation! See http://gcc.gnu.org/onlinedocs/libstdc++/manual/documentation_style.html

(Yeah. The docs literally say the docs need docs. We love a self-aware queen. 😭)


πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code.


And that's the whole page, bestie, you ate. 🌸 This one lives in libstdc++'s Library Functions Manual, section 3 β€” no date on this one, she's timeless, iykyk. βœ¨πŸ«ΆπŸ’–

πŸ“¦ where this page comes from
  • arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
  • fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • fedora 44: libstdc++-docs 16.2.1-2.fc44
  • fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms