comparison DEPENDENCIES/generic/include/boost/fusion/sequence/intrinsic/back.hpp @ 16:2665513ce2d3

Add boost headers
author Chris Cannam
date Tue, 05 Aug 2014 11:11:38 +0100
parents
children c530137014c0
comparison
equal deleted inserted replaced
15:663ca0da4350 16:2665513ce2d3
1 /*=============================================================================
2 Copyright (c) 2001-2011 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_BACK_09162005_0350)
8 #define FUSION_BACK_09162005_0350
9
10 #include <boost/fusion/sequence/intrinsic_fwd.hpp>
11 #include <boost/fusion/sequence/intrinsic/end.hpp>
12 #include <boost/fusion/iterator/prior.hpp>
13 #include <boost/fusion/iterator/deref.hpp>
14 #include <boost/mpl/bool.hpp>
15
16 namespace boost { namespace fusion
17 {
18 struct fusion_sequence_tag;
19
20 namespace result_of
21 {
22 template <typename Sequence>
23 struct back
24 : result_of::deref<typename result_of::prior<typename result_of::end<Sequence>::type>::type>
25 {};
26 }
27
28 template <typename Sequence>
29 inline typename result_of::back<Sequence>::type
30 back(Sequence& seq)
31 {
32 return *fusion::prior(fusion::end(seq));
33 }
34
35 template <typename Sequence>
36 inline typename result_of::back<Sequence const>::type
37 back(Sequence const& seq)
38 {
39 return *fusion::prior(fusion::end(seq));
40 }
41 }}
42
43 #endif