PageRenderTime 24ms CodeModel.GetById 16ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/fusion/container/map/detail/deref_impl.hpp

http://hadesmem.googlecode.com/
C++ Header | 45 lines | 33 code | 6 blank | 6 comment | 0 complexity | 401bf395490880828096ea10aba0cb07 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2009 Christopher Schmidt
 3
 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
 8#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP
 9#define BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP
10
11#include <boost/fusion/sequence/intrinsic/at.hpp>
12#include <boost/type_traits/is_const.hpp>
13
14namespace boost { namespace fusion { namespace extension
15{
16    template <typename>
17    struct deref_impl;
18
19    template <>
20    struct deref_impl<map_iterator_tag>
21    {
22        template <typename It>
23        struct apply
24        {
25            typedef typename
26                result_of::at<
27                    typename mpl::if_<
28                        is_const<typename It::seq_type>
29                      , typename It::seq_type::storage_type const
30                      , typename It::seq_type::storage_type
31                    >::type
32                  , typename It::index
33                >::type
34            type;
35
36            static type
37            call(It const& it)
38            {
39                return at<typename It::index>(it.seq->get_data());
40            }
41        };
42    };
43}}}
44
45#endif