Overflow Strategy Tags - SeqAn API Documentation

# Group Overflow Strategy Tags
The strategy for resizing containers.

## Grouped Tags Overview

- `typedef Tag<TagExact_> Exact;`
  Expand as far as needed.
- `typedef Tag<TagGenerous_> Generous;`
  Expand if needed, get precautionary extra space.
- `typedef Tag<TagInsist_> Insist;`
  No capacity check.
- `typedef Tag<TagLimit_> Limit;`
  Limit the contents to current capacity.

## Detailed Description

Changing the capacity of a container can invalidate the iterators of this container.

If no overflow tag is specified, most operations use the default overflow strategy given by DefaultOverflowImplicit or DefaultOverflowExplicit, depending on the kind of operation.

## See Also

- DefaultOverflowExplicit
- DefaultOverflowImplicit
- computeGenerousCapacity

## Grouped Tags Detail

### `typedef Tag<TagExact_> Exact;`

Defined in
  <seqan/sequence.h>

Expand as far as needed.

The capacity is only changed if the current capacity is not large enough. If the capacity can only be expanded up to a certain ammount, it will be increased as far as possible and the contents are limited to the new capacity.

Note that the capacity will never be shrinked. Use shrinkToFit to resize the capacity down to the current length.

### `typedef Tag<TagGenerous_> Generous;`

Defined in
  <seqan/sequence.h>

Expand if needed, get precautionary extra space.

Whenever the capacity has to be increased, the new capacity is choosen somewhat large than actually needed. This strategy limits the number of capacity changes, so that resizing takes armotized constant time. Use this strategy if the total amount of storage is unkown at first.

The new capacity is computed by computeGenerousCapacity. By default, it is guaranteed not to exceed about three halfs of the space that is used to store the data. The user can overload computeGenerousCapacity in order to change this behavior.

### `typedef Tag<TagInsist_> Insist;`

Defined in
  <seqan/sequence.h>

No capacity check.

### `typedef Tag<TagLimit_> Limit;`

Defined in
  <seqan/sequence.h>

Limit the contents to current capacity.

All entries that exceed the capacity are lost.

#### Dox Sources

    /*!
     * @defgroup OverflowStrategyTags Overflow Strategy Tags
     *
     * @brief The strategy for resizing containers.
     *
     * Changing the capacity of a container can invalidate the iterators of this
     * container.
     *
     * If no overflow tag is specified, most operations use the default overflow
     * strategy given by @link DefaultOverflowImplicit @endlink or @link
     * DefaultOverflowExplicit @endlink, depending on the kind of operation.
     *
     * @see StringConcept#computeGenerousCapacity
     * @see DefaultOverflowImplicit
     * @see DefaultOverflowExplicit
     *
     * @tag OverflowStrategyTags#Limit
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Limit the contents to current capacity.
     *
     * @signature typedef Tag<TagLimit_> Limit;
     *
     * All entries that exceed the capacity are lost.
     *
     * @tag OverflowStrategyTags#Generous
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Expand if needed, get precautionary extra space.
     *
     * @signature typedef Tag<TagGenerous_> Generous;
     *
     * Whenever the capacity has to be increased, the new capacity is choosen
     * somewhat large than actually needed. This strategy limits the number of
     * capacity changes, so that resizing takes armotized constant time. Use this
     * strategy if the total amount of storage is unkown at first.
     *
     * The new capacity is computed by @link StringConcept#computeGenerousCapacity
     * @endlink. By default, it is guaranteed not to exceed about three halfs of the
     * space that is used to store the data. The user can overload @link
     * StringConcept#computeGenerousCapacity @endlink in order to change this
     * behavior.
     *
     * @tag OverflowStrategyTags#Exact
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief Expand as far as needed.
     *
     * @signature typedef Tag<TagExact_> Exact;
     *
     * The capacity is only changed if the current capacity is not large enough. If
     * the capacity can only be expanded up to a certain ammount, it will be
     * increased as far as possible and the contents are limited to the new
     * capacity.
     *
     * Note that the capacity will never be shrinked. Use @link
     * ContainerConcept#shrinkToFit @endlink to resize the capacity down to the
     * current length.
     *
     * @tag OverflowStrategyTags#Insist
     *
     * @headerfile <seqan/sequence.h>
     *
     * @brief No capacity check.
     *
     * @note The user has to ensure that the container's capacity is large enough.
     *
     * @signature typedef Tag<TagInsist_> Insist;
     */