]> git.donarmstrong.com Git - rsem.git/blob - boost/fusion/algorithm/transformation/push_back.hpp
Updated boost to v1.55.0
[rsem.git] / boost / fusion / algorithm / transformation / push_back.hpp
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_PUSH_BACK_07162005_0235)
8 #define FUSION_PUSH_BACK_07162005_0235
9
10 #include <boost/fusion/support/detail/as_fusion_element.hpp>
11 #include <boost/fusion/view/joint_view/joint_view.hpp>
12 #include <boost/fusion/view/single_view/single_view.hpp>
13 #include <boost/fusion/support/is_sequence.hpp>
14 #include <boost/utility/enable_if.hpp>
15
16 namespace boost { namespace fusion
17 {
18     namespace result_of
19     {
20         template <typename Sequence, typename T>
21         struct push_back
22         {
23             typedef fusion::single_view<typename detail::as_fusion_element<T>::type> single_view;
24             typedef joint_view<Sequence, single_view const> type;
25         };
26     }
27
28     template <typename Sequence, typename T>
29     inline 
30     typename
31         lazy_enable_if<
32             traits::is_sequence<Sequence>
33           , result_of::push_back<Sequence const, T>
34         >::type
35     push_back(Sequence const& seq, T const& x)
36     {
37         typedef typename result_of::push_back<Sequence const, T> push_back;
38         typedef typename push_back::single_view single_view; 
39         typedef typename push_back::type result; 
40         single_view x_(x);
41         return result(seq, x_);
42     }
43 }}
44
45 #endif
46