1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
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_BACK_09162005_0350)
8 #define FUSION_BACK_09162005_0350
10 #include <boost/fusion/support/config.hpp>
11 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
12 #include <boost/fusion/sequence/intrinsic/end.hpp>
13 #include <boost/fusion/iterator/prior.hpp>
14 #include <boost/fusion/iterator/deref.hpp>
15 #include <boost/mpl/bool.hpp>
17 namespace boost { namespace fusion
19 struct fusion_sequence_tag;
23 template <typename Sequence>
25 : result_of::deref<typename result_of::prior<typename result_of::end<Sequence>::type>::type>
29 template <typename Sequence>
30 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
31 inline typename result_of::back<Sequence>::type
34 return *fusion::prior(fusion::end(seq));
37 template <typename Sequence>
38 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
39 inline typename result_of::back<Sequence const>::type
40 back(Sequence const& seq)
42 return *fusion::prior(fusion::end(seq));