Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.

[Home]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  
IteratorA model of Trivial IteratorAn iterator to be dereferenced.

Expression semantics

 Expression  Expression type  Precondition  Semantics  Postcondition 
typedef deref<Iterator>::type t;A typeEquivalent 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