1 ///////////////////////////////////////////////////////////////////////////////
2 /// \file push_back.hpp
3 /// Proto callables Fusion push_back
5 // Copyright 2010 Eric Niebler. Distributed under the Boost
6 // Software License, Version 1.0. (See accompanying file
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_BACK_HPP_EAN_11_27_2010
10 #define BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_BACK_HPP_EAN_11_27_2010
12 #include <boost/type_traits/add_const.hpp>
13 #include <boost/type_traits/remove_const.hpp>
14 #include <boost/type_traits/remove_reference.hpp>
15 #include <boost/fusion/include/push_back.hpp>
16 #include <boost/proto/proto_fwd.hpp>
18 namespace boost { namespace proto { namespace functional
20 /// \brief A PolymorphicFunctionObject type that invokes the
21 /// \c fusion::push_back() algorithm on its argument.
23 /// A PolymorphicFunctionObject type that invokes the
24 /// \c fusion::push_back() algorithm on its argument.
27 BOOST_PROTO_CALLABLE()
29 template<typename Sig>
32 template<typename This, typename Seq, typename T>
33 struct result<This(Seq, T)>
34 : fusion::result_of::push_back<
35 typename boost::add_const<typename boost::remove_reference<Seq>::type>::type
36 , typename boost::remove_const<typename boost::remove_reference<T>::type>::type
40 template<typename Seq, typename T>
41 typename fusion::result_of::push_back<Seq const, T>::type
42 operator ()(Seq const &seq, T const &t) const
44 return fusion::push_back(seq, t);