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_HPP_INCLUDED)
0010 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_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.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 <typename Function> class fused;
0027 
0028     //----- ---- --- -- - -  -   -
0029 
0030     template <typename Function>
0031     class fused
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(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<func_const_fwd_t,Seq const>::type 
0048         operator()(Seq const & s) const
0049         {
0050             return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
0051         }
0052 
0053         template <class Seq> 
0054         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0055         inline typename result_of::invoke<func_fwd_t,Seq const>::type 
0056         operator()(Seq const & s) 
0057         {
0058             return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
0059         }
0060 
0061         template <class Seq> 
0062         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0063         inline typename result_of::invoke<func_const_fwd_t,Seq>::type 
0064         operator()(Seq & s) const
0065         {
0066             return fusion::invoke<func_const_fwd_t>(this->fnc_transformed,s);
0067         }
0068 
0069         template <class Seq> 
0070         BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0071         inline typename result_of::invoke<func_fwd_t,Seq>::type 
0072         operator()(Seq & s) 
0073         {
0074             return fusion::invoke<func_fwd_t>(this->fnc_transformed,s);
0075         }
0076 
0077         template <typename Sig>
0078         struct result;
0079 
0080         template <class Self, class Seq>
0081         struct result< Self const (Seq) >
0082             : result_of::invoke<func_const_fwd_t,
0083                 typename boost::remove_reference<Seq>::type >
0084         { };
0085 
0086         template <class Self, class Seq>
0087         struct result< Self(Seq) >
0088             : result_of::invoke<func_fwd_t,
0089                 typename boost::remove_reference<Seq>::type >
0090         { };
0091 
0092     };
0093 
0094 }}
0095 
0096 #if defined (BOOST_MSVC)
0097 #  pragma warning(pop)
0098 #endif
0099 
0100 #endif
0101