fused_procedure.hpp

来自「Boost provides free peer-reviewed portab」· HPP 代码 · 共 71 行

HPP
71
字号
/*=============================================================================    Copyright (c) 2006-2007 Tobias Schwinger      Use modification and distribution are subject to the Boost Software     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at    http://www.boost.org/LICENSE_1_0.txt).==============================================================================*/#if !defined(BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED)#define BOOST_FUSION_FUNCTIONAL_ADAPTER_FUSED_PROCEDURE_HPP_INCLUDED#include <boost/type_traits/add_reference.hpp>#include <boost/fusion/functional/adapter/detail/access.hpp>#include <boost/fusion/functional/invocation/invoke_procedure.hpp>namespace boost { namespace fusion{    template <typename Function> class fused_procedure;    //----- ---- --- -- - -  -   -    template <typename Function>    class fused_procedure    {        Function fnc_transformed;        typedef typename detail::qf_c<Function>::type & func_const_fwd_t;        typedef typename detail::qf<Function>::type & func_fwd_t;    public:        inline explicit fused_procedure(func_const_fwd_t f = Function())            : fnc_transformed(f)        { }        template <class Seq>         inline void operator()(Seq const & s) const        {            fusion::invoke_procedure<                func_const_fwd_t >(this->fnc_transformed,s);        }        template <class Seq>         inline void operator()(Seq const & s)         {            fusion::invoke_procedure<                func_fwd_t >(this->fnc_transformed,s);        }        template <class Seq>         inline void operator()(Seq & s) const        {            fusion::invoke_procedure<                func_const_fwd_t >(this->fnc_transformed,s);        }        template <class Seq>         inline void operator()(Seq & s)         {            return fusion::invoke_procedure<                func_fwd_t >(this->fnc_transformed,s);        }        typedef void result_type;    };}}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?