fix doc example typo
[boost.git] / boost / fusion / container / map / detail / begin_impl.hpp
blob5fe25caf65d8e81c2bfc8123f5d7fffdd72fc14f
1 /*=============================================================================
2 Copyright (c) 2001-2006 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_BEGIN_IMPL_05222005_1108)
8 #define FUSION_BEGIN_IMPL_05222005_1108
10 #include <boost/fusion/sequence/intrinsic/begin.hpp>
11 #include <boost/type_traits/is_const.hpp>
12 #include <boost/mpl/eval_if.hpp>
13 #include <boost/mpl/identity.hpp>
15 namespace boost { namespace fusion
17 struct map_tag;
19 namespace extension
21 template <typename Tag>
22 struct begin_impl;
24 template <>
25 struct begin_impl<map_tag>
27 template <typename Sequence>
28 struct apply
30 typedef typename
31 result_of::begin<typename Sequence::storage_type>::type
32 iterator_type;
34 typedef typename
35 result_of::begin<typename Sequence::storage_type const>::type
36 const_iterator_type;
38 typedef typename
39 mpl::eval_if<
40 is_const<Sequence>
41 , mpl::identity<const_iterator_type>
42 , mpl::identity<iterator_type>
43 >::type
44 type;
46 static type
47 call(Sequence& m)
49 return fusion::begin(m.get_data());
56 #endif