1.. Iterators/Iterator Metafunctions//deref |50 2 3deref 4===== 5 6Synopsis 7-------- 8 9.. parsed-literal:: 10 11 template< 12 typename Iterator 13 > 14 struct deref 15 { 16 typedef |unspecified| type; 17 }; 18 19 20 21Description 22----------- 23 24Dereferences an iterator. 25 26 27Header 28------ 29 30.. parsed-literal:: 31 32 #include <boost/mpl/deref.hpp> 33 34 35 36Parameters 37---------- 38 39+---------------+---------------------------+-----------------------------------+ 40| Parameter | Requirement | Description | 41+===============+===========================+===================================+ 42| ``Iterator`` | |Forward Iterator| | The iterator to dereference. | 43+---------------+---------------------------+-----------------------------------+ 44 45 46Expression semantics 47-------------------- 48 49For any |Forward Iterator|\ s ``iter``: 50 51 52.. parsed-literal:: 53 54 typedef deref<iter>::type t; 55 56:Return type: 57 A type. 58 59:Precondition: 60 ``iter`` is dereferenceable. 61 62:Semantics: 63 ``t`` is identical to the element referenced by ``iter``. If ``iter`` is 64 a user-defined iterator, the library-provided default implementation is 65 equivalent to 66 67 .. parsed-literal:: 68 69 typedef iter::type t; 70 71 72 73 74Complexity 75---------- 76 77Amortized constant time. 78 79 80Example 81------- 82 83.. parsed-literal:: 84 85 typedef vector<char,short,int,long> types; 86 typedef begin<types>::type iter; 87 88 BOOST_MPL_ASSERT(( is_same< deref<iter>::type, char > )); 89 90 91See also 92-------- 93 94|Iterators|, |begin| / |end|, |next| 95 96 97.. copyright:: Copyright � 2001-2009 Aleksey Gurtovoy and David Abrahams 98 Distributed under the Boost Software License, Version 1.0. (See accompanying 99 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 100