Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:40

0001 /*=============================================================================
0002     Copyright (c) 2006-2007 Tobias Schwinger
0003   
0004     Use modification and distribution are subject to the Boost Software 
0005     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0006     http://www.boost.org/LICENSE_1_0.txt).
0007 ==============================================================================*/
0008 
0009 #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED)
0010 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED
0011 
0012 #include <boost/fusion/support/config.hpp>
0013 #include <boost/type_traits/add_reference.hpp>
0014 #include <boost/config.hpp>
0015 
0016 #include <boost/fusion/functional/adapter/detail/access.hpp>
0017 #include <boost/fusion/functional/invocation/invoke_function_object.hpp>
0018 
0019 #if defined (BOOST_MSVC)
0020 #  pragma warning(push)
0021 #  pragma warning (disable: 4512) // assignment operator could not be generated.
0022 #endif
0023 
0024 namespace boost { namespace fusion
0025 {
0026     template <class Function> class fused_function_object;
0027 
0028     //----- ---- --- -- - -  -   -
0029 
0030     template <class Function>
0031     class fused_function_object
0032     {
0033         Function fnc_transformed;
0034 
0035         typedef typename detail::qf_c<Function>::type & func_const_fwd_t;
0036         typedef typename detail::qf<Function>::type & func_fwd_t;
0037 
0038     public:
0039 
0040         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0041         inline explicit fused_function_object(func_const_fwd_t f = Function())
0042             : fnc_transformed(f)
0043         { }
0044 
0045         template <class Seq> 
0046         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0047         inline typename result_of::invoke_function_object<func_const_fwd_t,
0048             Seq const>::type operator()(Seq const & s) const
0049         {
0050           return fusion::invoke_function_object<
0051               func_const_fwd_t >(this->fnc_transformed,s);
0052         }
0053 
0054         template <class Seq> 
0055         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0056         inline typename result_of::invoke_function_object<func_fwd_t,
0057             Seq const>::type 
0058         operator()(Seq const & s) 
0059         {
0060           return fusion::invoke_function_object<
0061               func_fwd_t >(this->fnc_transformed,s);
0062         }
0063 
0064         template <class Seq> 
0065         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0066         inline typename result_of::invoke_function_object<func_const_fwd_t,
0067             Seq>::type
0068         operator()(Seq & s) const
0069         {
0070           return fusion::invoke_function_object<
0071               func_const_fwd_t >(this->fnc_transformed,s);
0072         }
0073 
0074         template <class Seq> 
0075         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0076         inline typename result_of::invoke_function_object<func_fwd_t,Seq>::type
0077         operator()(Seq & s) 
0078         {
0079           return fusion::invoke_function_object<
0080               func_fwd_t >(this->fnc_transformed,s);
0081         }
0082 
0083         template <typename Sig>
0084         struct result;
0085 
0086         template <class Self, class Seq>
0087         struct result< Self const (Seq) >
0088             : result_of::invoke_function_object<func_const_fwd_t, 
0089                 typename boost::remove_reference<Seq>::type >
0090         { };
0091 
0092         template <class Self, class Seq>
0093         struct result< Self(Seq) >
0094             : result_of::invoke_function_object<func_fwd_t,
0095                 typename boost::remove_reference<Seq>::type >
0096         { };
0097     };
0098 
0099 }}
0100 
0101 #if defined (BOOST_MSVC)
0102 #  pragma warning(pop)
0103 #endif
0104 
0105 #endif
0106