# deref

### Synopsis

    template<
          typename Iterator
        >
    struct deref
    {
        typedef typename Iterator::type type;
    };

### Description

Dereferences an iterator.

### Definition

    #include "boost/mpl/deref.hpp"

### Parameters

Parameter | Requirement | Description
--- | --- | ---
`Iterator` | A model of Trivial Iterator | An iterator to be dereferenced.

### Expression semantics

Expression | Expression type | Precondition | Semantics | Postcondition
--- | --- | --- | --- | ---
`typedef deref<Iterator>::type t;` | A type |  | Equivalent to `typedef Iterator::type t;`. | `Iterator` is dereferenceable

### Complexity

Amortized constant time.

### Example

    typedef list<char,short,int,long> types;
    typedef begin<types>::type iter;
    BOOST_STATIC_ASSERT(boost::is_same< deref<iter>::type,char >::value));

### See also

Iterators, `begin/end`

Table of Contents
Last edited March 10, 2003 5:30 am