Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(FUSION_BACK_09162005_0350)
|
Chris@16
|
8 #define FUSION_BACK_09162005_0350
|
Chris@16
|
9
|
Chris@101
|
10 #include <boost/fusion/support/config.hpp>
|
Chris@16
|
11 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
|
Chris@16
|
12 #include <boost/fusion/sequence/intrinsic/end.hpp>
|
Chris@16
|
13 #include <boost/fusion/iterator/prior.hpp>
|
Chris@16
|
14 #include <boost/fusion/iterator/deref.hpp>
|
Chris@16
|
15 #include <boost/mpl/bool.hpp>
|
Chris@16
|
16
|
Chris@16
|
17 namespace boost { namespace fusion
|
Chris@16
|
18 {
|
Chris@16
|
19 struct fusion_sequence_tag;
|
Chris@16
|
20
|
Chris@16
|
21 namespace result_of
|
Chris@16
|
22 {
|
Chris@16
|
23 template <typename Sequence>
|
Chris@16
|
24 struct back
|
Chris@16
|
25 : result_of::deref<typename result_of::prior<typename result_of::end<Sequence>::type>::type>
|
Chris@16
|
26 {};
|
Chris@16
|
27 }
|
Chris@16
|
28
|
Chris@16
|
29 template <typename Sequence>
|
Chris@101
|
30 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
31 inline typename result_of::back<Sequence>::type
|
Chris@16
|
32 back(Sequence& seq)
|
Chris@16
|
33 {
|
Chris@16
|
34 return *fusion::prior(fusion::end(seq));
|
Chris@16
|
35 }
|
Chris@16
|
36
|
Chris@16
|
37 template <typename Sequence>
|
Chris@101
|
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
|
Chris@16
|
39 inline typename result_of::back<Sequence const>::type
|
Chris@16
|
40 back(Sequence const& seq)
|
Chris@16
|
41 {
|
Chris@16
|
42 return *fusion::prior(fusion::end(seq));
|
Chris@16
|
43 }
|
Chris@16
|
44 }}
|
Chris@16
|
45
|
Chris@16
|
46 #endif
|