1 /*=============================================================================
2 Copyright (c) 2006-2007 Tobias Schwinger
4 Use modification and distribution are subject to the Boost Software
5 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt).
7 ==============================================================================*/
9 #if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED)
10 #define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_FUNCTION_OBJECT_HPP_INCLUDED
12 #include <boost/fusion/support/config.hpp>
13 #include <boost/type_traits/add_reference.hpp>
14 #include <boost/config.hpp>
16 #include <boost/fusion/functional/adapter/detail/access.hpp>
17 #include <boost/fusion/functional/invocation/invoke_function_object.hpp>
19 #if defined (BOOST_MSVC)
20 # pragma warning(push)
21 # pragma warning (disable: 4512) // assignment operator could not be generated.
24 namespace boost { namespace fusion
26 template <class Function> class fused_function_object;
28 //----- ---- --- -- - - - -
30 template <class Function>
31 class fused_function_object
33 Function fnc_transformed;
35 typedef typename detail::qf_c<Function>::type & func_const_fwd_t;
36 typedef typename detail::qf<Function>::type & func_fwd_t;
40 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
41 inline explicit fused_function_object(func_const_fwd_t f = Function())
46 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
47 inline typename result_of::invoke_function_object<func_const_fwd_t,
48 Seq const>::type operator()(Seq const & s) const
50 return fusion::invoke_function_object<
51 func_const_fwd_t >(this->fnc_transformed,s);
55 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
56 inline typename result_of::invoke_function_object<func_fwd_t,
58 operator()(Seq const & s)
60 return fusion::invoke_function_object<
61 func_fwd_t >(this->fnc_transformed,s);
65 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
66 inline typename result_of::invoke_function_object<func_const_fwd_t,
68 operator()(Seq & s) const
70 return fusion::invoke_function_object<
71 func_const_fwd_t >(this->fnc_transformed,s);
75 BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
76 inline typename result_of::invoke_function_object<func_fwd_t,Seq>::type
79 return fusion::invoke_function_object<
80 func_fwd_t >(this->fnc_transformed,s);
83 template <typename Sig>
86 template <class Self, class Seq>
87 struct result< Self const (Seq) >
88 : result_of::invoke_function_object<func_const_fwd_t,
89 typename boost::remove_reference<Seq>::type >
92 template <class Self, class Seq>
93 struct result< Self(Seq) >
94 : result_of::invoke_function_object<func_fwd_t,
95 typename boost::remove_reference<Seq>::type >
101 #if defined (BOOST_MSVC)
102 # pragma warning(pop)