### Method

# GLib VariantIter copy

since: 2.24

#### Declaration

    GVariantIter*
    g_variant_iter_copy (
      GVariantIter* iter
    )

#### Description

Creates a new heap-allocated `GVariantIter` to iterate over the container that was being iterated over by `iter`. Iteration begins on the new iterator from the current position of the old iterator but the two copies are independent past that point.

Use `g_variant_iter_free()` to free the return value when you no longer need it.

A reference is taken to the container that `iter` is iterating over and will be related only when `g_variant_iter_free()` is called.

Available since: 2.24

This method is not directly available to language bindings.

#### Return value

Type: `GVariantIter`

A new heap-allocated `GVariantIter`.

The caller of the method takes ownership of the data, and is responsible for freeing it.