File indexing completed on 2025-01-18 09:39:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef BOOST_LOG_UTILITY_FUNCTIONAL_AS_ACTION_HPP_INCLUDED_
0016 #define BOOST_LOG_UTILITY_FUNCTIONAL_AS_ACTION_HPP_INCLUDED_
0017
0018 #include <boost/log/detail/config.hpp>
0019 #include <boost/log/detail/header.hpp>
0020
0021 #ifdef BOOST_HAS_PRAGMA_ONCE
0022 #pragma once
0023 #endif
0024
0025 namespace boost {
0026
0027 BOOST_LOG_OPEN_NAMESPACE
0028
0029
0030 template< typename FunT >
0031 struct as_action_adapter
0032 {
0033 typedef typename FunT::result_type result_type;
0034
0035 BOOST_DEFAULTED_FUNCTION(as_action_adapter(), {})
0036 explicit as_action_adapter(FunT const& fun) : m_fun(fun) {}
0037
0038 template< typename AttributeT, typename ContextT >
0039 result_type operator() (AttributeT const& attr, ContextT const& ctx, bool& pass) const
0040 {
0041 return m_fun(attr);
0042 }
0043
0044 private:
0045 FunT m_fun;
0046 };
0047
0048 template< typename FunT >
0049 BOOST_FORCEINLINE as_action_adapter< FunT > as_action(FunT const& fun)
0050 {
0051 return as_action_adapter< FunT >(fun);
0052 }
0053
0054 BOOST_LOG_CLOSE_NAMESPACE
0055
0056 }
0057
0058 #include <boost/log/detail/footer.hpp>
0059
0060 #endif