# fn() defaultRng
Return the default random number generator object of a given type.

Defined in | <seqan/random.h>
Signature | `TRng defaultRng<TRng>();`

## Template Parameters

`TRng` | The random number generator type to construct.

## Return Values

`TRng` | Default random number generator of the given type TRng.

## Detailed Description

### Remarks

The random number generator will be default constructed, i.e. with the default seed.

This function is NOT thread-safe! Also, data structures and functions using defaultRng are not thread-safe. Data structures using global random number generator state should use pointers. This way, the random number generator state to be used can be set to be thread-local.

## Data Races

If not stated otherwise, concurrent invocation is not guaranteed to be thread-safe.

## See Also

- GetDefaultRng

#### Dox Sources

    /*!
     * @fn defaultRng
     *
     * @headerfile <seqan/random.h>
     *
     * @brief Return the default random number generator object of a given type.
     *
     * @signature TRng defaultRng<TRng>();
     *
     * @tparam TRng The random number generator type to construct.
     *
     * @return TRng Default random number generator of the given type TRng.
     *
     * @section Remarks
     *
     * The random number generator will be default constructed, i.e. with the
     * default seed.
     *
     * This function is NOT thread-safe! Also, data structures and functions using
     * defaultRng are not thread-safe. Data structures using global random number
     * generator state should use pointers. This way, the random number generator
     * state to be used can be set to be thread-local.
     *
     * @see GetDefaultRng
     */