1 /*=============================================================================
2     Copyright (c) 2010 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_ADAPTED_ARRAY_END_IMPL_HPP
9 #define BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP
10 
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/fusion/iterator/basic_iterator.hpp>
13 #include <boost/type_traits/rank.hpp>
14 #include <boost/type_traits/extent.hpp>
15 
16 namespace boost { namespace fusion { namespace extension
17 {
18     template <typename>
19     struct end_impl;
20 
21     template <>
22     struct end_impl<po_array_tag>
23     {
24         template <typename Seq>
25         struct apply
26         {
27             typedef
28                 basic_iterator<
29                     po_array_iterator_tag
30                   , random_access_traversal_tag
31                   , Seq
32                   , extent<Seq,rank<Seq>::value-1>::value
33                 >
34             type;
35 
36             BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
37             static type
callboost::fusion::extension::end_impl::apply38             call(Seq& seq)
39             {
40                 return type(seq,0);
41             }
42         };
43     };
44 }}}
45 
46 #endif
47