---
name: "__gnu_debug::def_hash_map"
section: "3"
platform: "linux"
package: "libstdc++6-doc"
version: "3.4.6-5"
release: "Debian 4.0 (Etch)"
platforms: ["linux"]
url: "https://new.carta.tech/__gnu_debug::def_hash_map"
---

# \_\_gnu\_debug::def\_hash\_map(3)

## NAME

\_\_gnu\_debug\_def::hash\_map -

## SYNOPSIS

Inherits **\_\_gnu\_cxx::hash\_map\< Value, Type, HashFcn, EqualKey, Alloc \>**, and **\_\_gnu\_debug::Safe\_sequence\< Sequence \>\< \_\_gnu\_debug\_def::hash\_map\< Value, Type, HashFcn, EqualKey, Alloc \> \>**.

### Public Types

typedef **Base::key\_type** **key\_type**\
 typedef **Base::data\_type** **data\_type**\
 typedef **Base::mapped\_type** **mapped\_type**\
 typedef **Base::value\_type** **value\_type**\
 typedef **Base::hasher** **hasher**\
 typedef **Base::key\_equal** **key\_equal**\
 typedef **Base::size\_type** **size\_type**\
 typedef **Base::difference\_type** **difference\_type**\
 typedef **Base::pointer** **pointer**\
 typedef **Base::const\_pointer** **const\_pointer**\
 typedef **Base::reference** **reference**\
 typedef **Base::const\_reference** **const\_reference**\
 typedef **\_\_gnu\_debug::Safe\_iterator**\< typename **Base::iterator**, **hash\_map** \> **iterator**\
 typedef **\_\_gnu\_debug::Safe\_iterator**\< typename **Base::const\_iterator**, **hash\_map** \> **const\_iterator**\
 typedef **Base::allocator\_type** **allocator\_type**\

### Public Member Functions

**hash\_map** ()\
 **hash\_map** (**size\_type** n)\
 **hash\_map** (**size\_type** n, const **hasher** &\_\_hf)\
 **hash\_map** (**size\_type** n, const **hasher** &\_\_hf, const **key\_equal** &\_\_eql, const **allocator\_type** &a=**allocator\_type**())\
 template\<typename InputIterator\> **hash\_map** (InputIterator \_\_f, InputIterator \_\_l)\
 template\<typename InputIterator\> **hash\_map** (InputIterator \_\_f, InputIterator \_\_l, **size\_type** n)\
 template\<typename InputIterator\> **hash\_map** (InputIterator \_\_f, InputIterator \_\_l, **size\_type** n, const **hasher** &\_\_hf)\
 template\<typename InputIterator\> **hash\_map** (InputIterator \_\_f, InputIterator \_\_l, **size\_type** n, const **hasher** &\_\_hf, const **key\_equal** &\_\_eql, const **allocator\_type** &a=**allocator\_type**())\
 **hash\_map** (const **Base** &x)\
 void **swap** (**hash\_map** &x)\
 **iterator** **begin** ()\
 **iterator** **end** ()\
 **const\_iterator** **begin** () const\
 **const\_iterator** **end** () const\
 **std::pair**\< **iterator**, bool \> **insert** (const **value\_type** &\_\_obj)\
 template\<typename InputIterator\> void **insert** (InputIterator first, InputIterator last)\
 **std::pair**\< **iterator**, bool \> **insert\_noresize** (const **value\_type** &\_\_obj)\
 **iterator** **find** (const **key\_type** &\_\_key)\
 **const\_iterator** **find** (const **key\_type** &\_\_key) const\
 **std::pair**\< **iterator**, **iterator** \> **equal\_range** (const **key\_type** &\_\_key)\
 **std::pair**\< **const\_iterator**, **const\_iterator** \> **equal\_range** (const **key\_type** &\_\_key) const\
 **size\_type** **erase** (const **key\_type** &\_\_key)\
 void **erase** (**iterator** \_\_it)\
 void **erase** (**iterator** first, **iterator** last)\
 void **clear** ()\
 **Base** & **M\_base** ()\
 const **Base** & **M\_base** () const\
 **hasher** **hash\_funct** () const\
 **key\_equal** **key\_eq** () const\
 **allocator\_type** **get\_allocator** () const\
 **size\_type** **size** () const\
 **size\_type** **max\_size** () const\
 bool **empty** () const\
 void **swap** (**hash\_map** &\_\_hs)\
 pair\< **iterator**, bool \> **insert** (const **value\_type** &\_\_obj)\
 pair\< **iterator**, bool \> **insert\_noresize** (const **value\_type** &\_\_obj)\
 **iterator** **find** (const **key\_type** &\_\_key)\
 **const\_iterator** **find** (const **key\_type** &\_\_key) const\
 Type & **operator\[\]** (const **key\_type** &\_\_key)\
 **size\_type** **count** (const **key\_type** &\_\_key) const\
 pair\< **iterator**, **iterator** \> **equal\_range** (const **key\_type** &\_\_key)\
 pair\< **const\_iterator**, **const\_iterator** \> **equal\_range** (const **key\_type** &\_\_key) const\
 **size\_type** **erase** (const **key\_type** &\_\_key)\
 void **erase** (**iterator** \_\_it)\
 void **erase** (**iterator** \_\_f, **iterator** \_\_l)\
 void **resize** (**size\_type** \_\_hint)\
 **size\_type** **bucket\_count** () const\
 **size\_type** **max\_bucket\_count** () const\
 **size\_type** **elems\_in\_bucket** (**size\_type** n) const \
 template\<typename Predicate\> void **M\_invalidate\_if** (Predicate pred)\
 template\<typename Iterator\> void **M\_transfer\_iter** (const Safe\_iterator\< Iterator, Sequence \> &x)\
 void **M\_invalidate\_all** () const\

### Public Attributes

Safe\_iterator\_base \* **M\_iterators**\
 *The list of mutable iterators that reference this container.*  Safe\_iterator\_base \* **M\_const\_iterators**\
 *The list of constant iterators that reference this container.*  unsigned int **M\_version**\
 *The container version number. This number may never be 0.*

### Protected Member Functions

void **M\_detach\_all** ()\
 void **M\_detach\_singular** ()\
 void **M\_revalidate\_singular** ()\
 void **M\_swap** (Safe\_sequence\_base &x)\

### Private Types

typedef **\_\_gnu\_cxx::hash\_map**\< Value, Type, HashFcn, EqualKey, Alloc \> **Base**\
 typedef **\_\_gnu\_debug::Safe\_sequence**\< **hash\_map** \> **Safe\_base**\

### Private Member Functions

void **M\_invalidate\_all** ()\

## Detailed Description

### template\<typename Value, typename Type, typename HashFcn = \_\_gnu\_cxx::hash\<Value\>, typename EqualKey = std::equal\_to\<Value\>, typename Alloc = std::allocator\<Value\>\> class \_\_gnu\_debug\_def::hash\_map\< Value, Type, HashFcn, EqualKey, Alloc \>

Definition at line 43 of file debug/hash\_map.h.

## Member Function Documentation

### template\<typename Sequence\> template\<typename Predicate\> void \_\_gnu\_debug::Safe\_sequence\< Sequence \>::M\_invalidate\_if (Predicate pred)` [inherited]`

Invalidates all iterators `x` that reference this sequence, are not singular, and for which `pred(x)` returns `true`. The user of this routine should be careful not to make copies of the iterators passed to `pred`, as the copies may interfere with the invalidation.

Definition at line 120 of file safe\_sequence.h.

### template\<typename Sequence\> template\<typename Iterator\> void \_\_gnu\_debug::Safe\_sequence\< Sequence \>::M\_transfer\_iter (const Safe\_iterator\< Iterator, Sequence \> & x)` [inherited]`

Transfers all iterators that reference this memory location to this sequence from whatever sequence they are attached to.

Definition at line 152 of file safe\_sequence.h.

### void \_\_gnu\_debug::Safe\_sequence\_base::M\_detach\_all ()` [protected, inherited]`

Detach all iterators, leaving them singular.

Definition at line 114 of file debug.cc.

### void \_\_gnu\_debug::Safe\_sequence\_base::M\_detach\_singular ()` [protected, inherited]`

Detach all singular iterators.

**Postcondition:**

for all iterators i attached to this sequence, i-\>M\_version == M\_version.

Definition at line 133 of file debug.cc.

### void \_\_gnu\_debug::Safe\_sequence\_base::M\_revalidate\_singular ()` [protected, inherited]`

Revalidates all attached singular iterators. This method may be used to validate iterators that were invalidated before (but for some reasion, such as an exception, need to become valid again).

Definition at line 154 of file debug.cc.

### void \_\_gnu\_debug::Safe\_sequence\_base::M\_swap (Safe\_sequence\_base & x)` [protected, inherited]`

Swap this sequence with the given sequence. This operation also swaps ownership of the iterators, so that when the operation is complete all iterators that originally referenced one container now reference the other container.

Definition at line 172 of file debug.cc.

References \_\_gnu\_debug::swap().

### void \_\_gnu\_debug::Safe\_sequence\_base::M\_invalidate\_all () const` [inline, inherited]`

Invalidates all iterators.

Definition at line 202 of file safe\_base.h.

## Member Data Documentation

### Safe\_iterator\_base\* \_\_gnu\_debug::Safe\_sequence\_base::M\_iterators` [inherited]`

The list of mutable iterators that reference this container.

Definition at line 153 of file safe\_base.h.

### Safe\_iterator\_base\* \_\_gnu\_debug::Safe\_sequence\_base::M\_const\_iterators` [inherited]`

The list of constant iterators that reference this container.

Definition at line 156 of file safe\_base.h.

### unsigned int \_\_gnu\_debug::Safe\_sequence\_base::M\_version` [mutable, inherited]`

The container version number. This number may never be 0.

Definition at line 159 of file safe\_base.h.

## Author

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