### Function

# GLib HashTable foreach_steal

#### Declaration

    guint
    g_hash_table_foreach_steal (
      GHashTable* hash_table,
      GHRFunc func,
      gpointer user_data
    )

#### Description

Calls the given function for each key/value pair in the `GHashTable`. If the function returns `TRUE`, then the key/value pair is removed from the `GHashTable`, but no key or value destroy functions are called.

See `GHashTableIter` for an alternative way to loop over the key/value pairs in the hash table.

#### Parameters

`hash_table`

  Type: `GHashTable`

  A `GHashTable`.

  The data is owned by the caller of the function.

`func`

  Type: `GHRFunc`

  The function to call for each key/value pair.

`user_data`

  Type: `gpointer`

  User data to pass to the function.

  The argument can be `NULL`.
  The data is owned by the caller of the function.

#### Return value

Type: `guint`

The number of key/value pairs removed.