PageRenderTime 28ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/Src/Dependencies/Boost/boost/fusion/sequence/intrinsic/end.hpp

http://hadesmem.googlecode.com/
C++ Header | 84 lines | 65 code | 12 blank | 7 comment | 0 complexity | cc670ff61a856a3cee072d5a13f57708 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2006 Joel de Guzman
 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#if !defined(FUSION_END_04052005_1141)
 8#define FUSION_END_04052005_1141
 9
10#include <boost/fusion/support/tag_of.hpp>
11#include <boost/fusion/support/is_sequence.hpp>
12#include <boost/utility/enable_if.hpp>
13
14namespace boost { namespace fusion
15{
16    // Special tags:
17    struct sequence_facade_tag;
18    struct boost_tuple_tag; // boost::tuples::tuple tag
19    struct boost_array_tag; // boost::array tag
20    struct mpl_sequence_tag; // mpl sequence tag
21    struct std_pair_tag; // std::pair tag
22
23    namespace extension
24    {
25        template <typename Tag>
26        struct end_impl
27        {
28            template <typename Sequence>
29            struct apply;
30        };
31
32        template <>
33        struct end_impl<sequence_facade_tag>
34        {
35            template <typename Sequence>
36            struct apply : Sequence::template end<Sequence> {};
37        };
38
39        template <>
40        struct end_impl<boost_tuple_tag>;
41
42        template <>
43        struct end_impl<boost_array_tag>;
44
45        template <>
46        struct end_impl<mpl_sequence_tag>;
47
48        template <>
49        struct end_impl<std_pair_tag>;
50    }
51
52    namespace result_of
53    {
54        template <typename Sequence>
55        struct end
56            : extension::end_impl<typename detail::tag_of<Sequence>::type>::
57                template apply<Sequence>
58        {};
59    }
60
61    template <typename Sequence>
62    inline typename
63        lazy_enable_if<
64            traits::is_sequence<Sequence>
65          , result_of::end<Sequence>
66        >::type const
67    end(Sequence& seq)
68    {
69        return result_of::end<Sequence>::call(seq);
70    }
71
72    template <typename Sequence>
73    inline typename
74        lazy_enable_if<
75            traits::is_sequence<Sequence>
76          , result_of::end<Sequence const>
77        >::type const
78    end(Sequence const& seq)
79    {
80        return result_of::end<Sequence const>::call(seq);
81    }
82}}
83
84#endif