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_SAVE_RESULT_HPP_INCLUDED_
0016 #define BOOST_LOG_UTILITY_FUNCTIONAL_SAVE_RESULT_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, typename AssigneeT >
0031 struct save_result_wrapper
0032 {
0033 typedef void result_type;
0034
0035 save_result_wrapper(FunT fun, AssigneeT& assignee) : m_fun(fun), m_assignee(assignee) {}
0036
0037 template< typename ArgT >
0038 result_type operator() (ArgT const& arg) const
0039 {
0040 m_assignee = m_fun(arg);
0041 }
0042
0043 private:
0044 FunT m_fun;
0045 AssigneeT& m_assignee;
0046 };
0047
0048 template< typename FunT, typename AssigneeT >
0049 BOOST_FORCEINLINE save_result_wrapper< FunT, AssigneeT > save_result(FunT const& fun, AssigneeT& assignee)
0050 {
0051 return save_result_wrapper< FunT, AssigneeT >(fun, assignee);
0052 }
0053
0054 BOOST_LOG_CLOSE_NAMESPACE
0055
0056 }
0057
0058 #include <boost/log/detail/footer.hpp>
0059
0060 #endif