2 * Copyright Andrey Semashev 2007 - 2015.
3 * Distributed under the Boost Software License, Version 1.0.
4 * (See accompanying file LICENSE_1_0.txt or copy at
5 * http://www.boost.org/LICENSE_1_0.txt)
8 * \file custom_terminal_spec.hpp
9 * \author Andrey Semashev
12 * The header contains Boost.Phoenix custom terminal specialization for Boost.Log terminals.
15 #ifndef BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_
16 #define BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_
18 #include <boost/mpl/bool.hpp>
19 #include <boost/phoenix/core/terminal_fwd.hpp>
20 #include <boost/phoenix/core/is_nullary.hpp>
21 #include <boost/phoenix/core/terminal.hpp> // needed for terminal-related part of the grammar
22 #include <boost/type_traits/remove_cv.hpp>
23 #include <boost/type_traits/remove_reference.hpp>
24 #include <boost/utility/result_of.hpp>
25 #include <boost/log/detail/config.hpp>
26 #include <boost/log/detail/header.hpp>
28 #ifdef BOOST_HAS_PRAGMA_ONCE
36 template< typename T >
37 struct is_custom_terminal< T, typename T::_is_boost_log_terminal > :
42 template< typename T >
43 struct custom_terminal< T, typename T::_is_boost_log_terminal >
45 typedef custom_terminal< T, typename T::_is_boost_log_terminal > this_type;
50 template< typename ThisT, typename TermT, typename ContextT >
51 struct result< ThisT(TermT, ContextT) >
53 typedef typename remove_cv< typename remove_reference< TermT >::type >::type term;
54 typedef typename boost::result_of< const term(ContextT) >::type type;
57 template< typename ContextT >
58 typename result< const this_type(T const&, ContextT&) >::type operator() (T const& term, ContextT& ctx) const
64 } // namespace phoenix
68 #include <boost/log/detail/footer.hpp>
70 #endif // BOOST_LOG_DETAIL_CUSTOM_TERMINAL_SPEC_HPP_INCLUDED_