PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/Src/Dependencies/Boost/boost/fusion/container/deque/detail/begin_impl.hpp

http://hadesmem.googlecode.com/
C++ Header | 46 lines | 31 code | 8 blank | 7 comment | 0 complexity | 403ea8ef51cae7e20733aa17a829aa42 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 Joel de Guzman
 3    Copyright (c) 2005-2006 Dan Marsden
 4
 5    Distributed under the Boost Software License, Version 1.0. (See accompanying 
 6    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 7==============================================================================*/
 8#if !defined(BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034)
 9#define BOOST_FUSION_DEQUE_BEGIN_IMPL_09122006_2034
10
11#include <boost/fusion/container/deque/deque_iterator.hpp>
12
13#include <boost/mpl/equal_to.hpp>
14#include <boost/mpl/if.hpp>
15
16namespace boost { namespace fusion { 
17
18    struct deque_tag;
19
20    namespace extension 
21    {
22        template<typename T>
23        struct begin_impl;
24        
25        template<>
26        struct begin_impl<deque_tag>
27        {
28            template<typename Sequence>
29            struct apply
30            {
31                typedef typename mpl::if_<
32                    mpl::equal_to<typename Sequence::next_down, typename Sequence::next_up>,
33                    deque_iterator<Sequence, 0>,
34                    deque_iterator<
35                    Sequence, mpl::plus<typename Sequence::next_down, mpl::int_<1> >::value> >::type type;
36                
37                static type call(Sequence& seq)
38                {
39                    return type(seq);
40                }
41            };
42        };
43    }
44}}
45
46#endif