1 .. Sequences/Intrinsic Metafunctions//value_type
17 typedef |unspecified| type;
25 Returns the |value| that would be used for element ``X`` in ``Sequence``.
33 #include <boost/mpl/value_type.hpp>
39 |Tag Dispatched Metafunction|
45 +---------------+---------------------------+-----------------------------------------------+
46 | Parameter | Requirement | Description |
47 +===============+===========================+===============================================+
48 | ``Sequence`` | |Associative Sequence| | A sequence to query. |
49 +---------------+---------------------------+-----------------------------------------------+
50 | ``X`` | Any type | The type to get the |value| for. |
51 +---------------+---------------------------+-----------------------------------------------+
57 For any |Associative Sequence| ``s``, and an artibrary type ``x``:
62 typedef value_type<s,x>::type v;
68 ``x`` can be put in ``s``.
71 ``v`` is the |value| that would be used for ``x`` in ``s``.
77 has_key< s,key_type<s,x>::type >::type
82 at< s,key_type<s,x>::type >::type
84 is identical to ``value_type<s,x>::type``.
91 Amortized constant time.
99 typedef value_type< map<>,pair<int,unsigned> >::type v1;
100 typedef value_type< set<>,pair<int,unsigned> >::type v2;
102 BOOST_MPL_ASSERT(( is_same< v1,unsigned > ));
103 BOOST_MPL_ASSERT(( is_same< v2,pair<int,unsigned> > ));
109 |Associative Sequence|, |key_type|, |at|, |set|, |map|
112 .. copyright:: Copyright © 2001-2009 Aleksey Gurtovoy and David Abrahams
113 Distributed under the Boost Software License, Version 1.0. (See accompanying
114 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)