Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:50:27

0001 ///////////////////////////////////////////////////////////////////////////////
0002 /// \file push_front.hpp
0003 /// Proto callables Fusion push_front
0004 //
0005 //  Copyright 2010 Eric Niebler. Distributed under the Boost
0006 //  Software License, Version 1.0. (See accompanying file
0007 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #ifndef BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010
0010 #define BOOST_PROTO_FUNCTIONAL_FUSION_PUSH_FRONT_HPP_EAN_11_27_2010
0011 
0012 #include <boost/type_traits/add_const.hpp>
0013 #include <boost/type_traits/remove_const.hpp>
0014 #include <boost/type_traits/remove_reference.hpp>
0015 #include <boost/fusion/include/push_front.hpp>
0016 #include <boost/proto/proto_fwd.hpp>
0017 
0018 namespace boost { namespace proto { namespace functional
0019 {
0020     /// \brief A PolymorphicFunctionObject type that invokes the
0021     /// \c fusion::push_front() algorithm on its argument.
0022     ///
0023     /// A PolymorphicFunctionObject type that invokes the
0024     /// \c fusion::push_front() algorithm on its argument.
0025     struct push_front
0026     {
0027         BOOST_PROTO_CALLABLE()
0028 
0029         template<typename Sig>
0030         struct result;
0031 
0032         template<typename This, typename Seq, typename T>
0033         struct result<This(Seq, T)>
0034           : fusion::result_of::push_front<
0035                 typename boost::add_const<typename boost::remove_reference<Seq>::type>::type
0036               , typename boost::remove_const<typename boost::remove_reference<T>::type>::type
0037             >
0038         {};
0039 
0040         template<typename Seq, typename T>
0041         typename fusion::result_of::push_front<Seq const, T>::type
0042         operator ()(Seq const &seq, T const &t) const
0043         {
0044             return fusion::push_front(seq, t);
0045         }
0046     };
0047 }}}
0048 
0049 #endif