char_decorator.hpp 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /*
  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)
  6. */
  7. /*!
  8. * \file formatters/char_decorator.hpp
  9. * \author Andrey Semashev
  10. * \date 17.11.2012
  11. *
  12. * The header contains implementation of a character decorator.
  13. */
  14. #ifndef BOOST_LOG_EXPRESSIONS_FORMATTERS_CHAR_DECORATOR_HPP_INCLUDED_
  15. #define BOOST_LOG_EXPRESSIONS_FORMATTERS_CHAR_DECORATOR_HPP_INCLUDED_
  16. #include <vector>
  17. #include <string>
  18. #include <iterator>
  19. #include <boost/assert.hpp>
  20. #include <boost/static_assert.hpp>
  21. #include <boost/mpl/bool.hpp>
  22. #include <boost/range/begin.hpp>
  23. #include <boost/range/end.hpp>
  24. #include <boost/range/size.hpp>
  25. #include <boost/range/const_iterator.hpp>
  26. #include <boost/range/value_type.hpp>
  27. #include <boost/move/core.hpp>
  28. #include <boost/move/utility_core.hpp>
  29. #include <boost/core/addressof.hpp>
  30. #include <boost/phoenix/core/actor.hpp>
  31. #include <boost/phoenix/core/meta_grammar.hpp>
  32. #include <boost/phoenix/core/terminal_fwd.hpp>
  33. #include <boost/phoenix/core/is_nullary.hpp>
  34. #include <boost/phoenix/core/environment.hpp>
  35. #include <boost/phoenix/support/vector.hpp>
  36. #include <boost/fusion/sequence/intrinsic/at_c.hpp>
  37. #include <boost/type_traits/is_same.hpp>
  38. #include <boost/type_traits/remove_cv.hpp>
  39. #include <boost/type_traits/remove_reference.hpp>
  40. #include <boost/log/detail/config.hpp>
  41. #include <boost/log/detail/custom_terminal_spec.hpp>
  42. #include <boost/log/detail/deduce_char_type.hpp>
  43. #include <boost/log/detail/sfinae_tools.hpp>
  44. #include <boost/log/utility/formatting_ostream.hpp>
  45. #include <boost/log/detail/header.hpp>
  46. #ifdef BOOST_HAS_PRAGMA_ONCE
  47. #pragma once
  48. #endif
  49. namespace boost {
  50. BOOST_LOG_OPEN_NAMESPACE
  51. namespace expressions {
  52. namespace aux {
  53. template< typename RangeT >
  54. struct string_const_iterator : range_const_iterator< RangeT > {};
  55. template< >
  56. struct string_const_iterator< char* > { typedef char* type; };
  57. template< >
  58. struct string_const_iterator< const char* > { typedef const char* type; };
  59. template< >
  60. struct string_const_iterator< wchar_t* > { typedef wchar_t* type; };
  61. template< >
  62. struct string_const_iterator< const wchar_t* > { typedef const wchar_t* type; };
  63. } // namespace aux
  64. /*!
  65. * A simple character decorator implementation. This implementation replaces string patterns in the source string with
  66. * the fixed replacements. Source patterns and replacements can be specified at the object construction.
  67. */
  68. template< typename CharT >
  69. class pattern_replacer
  70. {
  71. public:
  72. //! Result type
  73. typedef void result_type;
  74. //! Character type
  75. typedef CharT char_type;
  76. //! String type
  77. typedef std::basic_string< char_type > string_type;
  78. private:
  79. //! Lengths of source pattern and replacement
  80. struct string_lengths
  81. {
  82. unsigned int from_len, to_len;
  83. };
  84. //! List of the decorations to apply
  85. typedef std::vector< string_lengths > string_lengths_list;
  86. private:
  87. //! Characters of the interleaved source patterns and replacements
  88. string_type m_decoration_chars;
  89. //! List of the decorations to apply
  90. string_lengths_list m_string_lengths;
  91. public:
  92. /*!
  93. * Initializing constructor. Creates a pattern replacer with the specified \a decorations.
  94. * The provided decorations must be a sequence of \c std::pair of strings. The first element
  95. * of each pair is the source pattern, and the second one is the corresponding replacement.
  96. */
  97. template< typename RangeT >
  98. explicit pattern_replacer(RangeT const& decorations
  99. #ifndef BOOST_LOG_DOXYGEN_PASS
  100. // This is needed for a workaround against an MSVC-10 and older bug in constructor overload resolution
  101. , typename boost::enable_if_has_type< typename range_const_iterator< RangeT >::type, boost::log::aux::sfinae_dummy >::type = boost::log::aux::sfinae_dummy()
  102. #endif
  103. )
  104. {
  105. typedef typename range_const_iterator< RangeT >::type iterator;
  106. for (iterator it = boost::begin(decorations), end_ = boost::end(decorations); it != end_; ++it)
  107. {
  108. string_lengths lens;
  109. {
  110. typedef typename aux::string_const_iterator< typename range_value< RangeT >::type::first_type >::type first_iterator;
  111. first_iterator b = string_begin(it->first), e = string_end(it->first);
  112. lens.from_len = static_cast< unsigned int >(std::distance(b, e));
  113. m_decoration_chars.append(b, e);
  114. }
  115. {
  116. typedef typename aux::string_const_iterator< typename range_value< RangeT >::type::second_type >::type second_iterator;
  117. second_iterator b = string_begin(it->second), e = string_end(it->second);
  118. lens.to_len = static_cast< unsigned int >(std::distance(b, e));
  119. m_decoration_chars.append(b, e);
  120. }
  121. m_string_lengths.push_back(lens);
  122. }
  123. }
  124. /*!
  125. * Initializing constructor. Creates a pattern replacer with decorations specified
  126. * in form of two same-sized string sequences. Each <tt>i</tt>'th decoration will be
  127. * <tt>from[i]</tt> -> <tt>to[i]</tt>.
  128. */
  129. template< typename FromRangeT, typename ToRangeT >
  130. pattern_replacer(FromRangeT const& from, ToRangeT const& to)
  131. {
  132. typedef typename range_const_iterator< FromRangeT >::type iterator1;
  133. typedef typename range_const_iterator< ToRangeT >::type iterator2;
  134. iterator1 it1 = boost::begin(from), end1 = boost::end(from);
  135. iterator2 it2 = boost::begin(to), end2 = boost::end(to);
  136. for (; it1 != end1 && it2 != end2; ++it1, ++it2)
  137. {
  138. string_lengths lens;
  139. {
  140. typedef typename aux::string_const_iterator< typename range_value< FromRangeT >::type >::type from_iterator;
  141. from_iterator b = string_begin(*it1), e = string_end(*it1);
  142. lens.from_len = static_cast< unsigned int >(std::distance(b, e));
  143. m_decoration_chars.append(b, e);
  144. }
  145. {
  146. typedef typename aux::string_const_iterator< typename range_value< ToRangeT >::type >::type to_iterator;
  147. to_iterator b = string_begin(*it2), e = string_end(*it2);
  148. lens.to_len = static_cast< unsigned int >(std::distance(b, e));
  149. m_decoration_chars.append(b, e);
  150. }
  151. m_string_lengths.push_back(lens);
  152. }
  153. // Both sequences should be of the same size
  154. BOOST_ASSERT(it1 == end1);
  155. BOOST_ASSERT(it2 == end2);
  156. }
  157. //! Copy constructor
  158. pattern_replacer(pattern_replacer const& that) : m_decoration_chars(that.m_decoration_chars), m_string_lengths(that.m_string_lengths)
  159. {
  160. }
  161. //! Applies string replacements starting from the specified position
  162. result_type operator() (string_type& str, typename string_type::size_type start_pos = 0) const
  163. {
  164. typedef typename string_type::size_type size_type;
  165. const char_type* from_chars = m_decoration_chars.c_str();
  166. for (typename string_lengths_list::const_iterator it = m_string_lengths.begin(), end = m_string_lengths.end(); it != end; ++it)
  167. {
  168. const unsigned int from_len = it->from_len, to_len = it->to_len;
  169. const char_type* const to_chars = from_chars + from_len;
  170. for (size_type pos = str.find(from_chars, start_pos, from_len); pos != string_type::npos; pos = str.find(from_chars, pos, from_len))
  171. {
  172. str.replace(pos, from_len, to_chars, to_len);
  173. pos += to_len;
  174. }
  175. from_chars = to_chars + to_len;
  176. }
  177. }
  178. private:
  179. static char_type* string_begin(char_type* p)
  180. {
  181. return p;
  182. }
  183. static const char_type* string_begin(const char_type* p)
  184. {
  185. return p;
  186. }
  187. template< typename RangeT >
  188. static typename range_const_iterator< RangeT >::type string_begin(RangeT const& r)
  189. {
  190. return boost::begin(r);
  191. }
  192. static char_type* string_end(char_type* p)
  193. {
  194. return p + std::char_traits< char_type >::length(p);
  195. }
  196. static const char_type* string_end(const char_type* p)
  197. {
  198. return p + std::char_traits< char_type >::length(p);
  199. }
  200. template< typename RangeT >
  201. static typename range_const_iterator< RangeT >::type string_end(RangeT const& r)
  202. {
  203. return boost::end(r);
  204. }
  205. };
  206. namespace aux {
  207. //! Character decorator stream output terminal
  208. template< typename LeftT, typename SubactorT, typename ImplT >
  209. class char_decorator_output_terminal
  210. {
  211. private:
  212. //! Self type
  213. typedef char_decorator_output_terminal< LeftT, SubactorT, ImplT > this_type;
  214. public:
  215. #ifndef BOOST_LOG_DOXYGEN_PASS
  216. //! Internal typedef for type categorization
  217. typedef void _is_boost_log_terminal;
  218. #endif
  219. //! Implementation type
  220. typedef ImplT impl_type;
  221. //! Character type
  222. typedef typename impl_type::char_type char_type;
  223. //! String type
  224. typedef typename impl_type::string_type string_type;
  225. //! Adopted actor type
  226. typedef SubactorT subactor_type;
  227. //! Result type definition
  228. template< typename >
  229. struct result;
  230. template< typename ThisT, typename ContextT >
  231. struct result< ThisT(ContextT) >
  232. {
  233. typedef typename remove_cv< typename remove_reference< ContextT >::type >::type context_type;
  234. typedef typename phoenix::evaluator::impl<
  235. typename LeftT::proto_base_expr&,
  236. context_type,
  237. phoenix::unused
  238. >::result_type type;
  239. };
  240. private:
  241. //! Left argument actor
  242. LeftT m_left;
  243. //! Adopted formatter actor
  244. subactor_type m_subactor;
  245. //! Implementation type
  246. impl_type m_impl;
  247. public:
  248. /*!
  249. * Initializing constructor. Creates decorator of the \a fmt formatter with the specified \a decorations.
  250. */
  251. char_decorator_output_terminal(LeftT const& left, subactor_type const& sub, impl_type const& impl) :
  252. m_left(left), m_subactor(sub), m_impl(impl)
  253. {
  254. }
  255. /*!
  256. * Copy constructor
  257. */
  258. char_decorator_output_terminal(char_decorator_output_terminal const& that) :
  259. m_left(that.m_left), m_subactor(that.m_subactor), m_impl(that.m_impl)
  260. {
  261. }
  262. /*!
  263. * Invokation operator
  264. */
  265. template< typename ContextT >
  266. typename result< this_type(ContextT const&) >::type operator() (ContextT const& ctx)
  267. {
  268. // Flush the stream and keep the current write position in the target string
  269. typedef typename result< this_type(ContextT const&) >::type result_type;
  270. result_type strm = phoenix::eval(m_left, ctx);
  271. strm.flush();
  272. typename string_type::size_type const start_pos = strm.rdbuf()->storage()->size();
  273. // Invoke the adopted formatter
  274. phoenix::eval(m_subactor, ctx);
  275. // Flush the buffered characters and apply decorations
  276. strm.flush();
  277. m_impl(*strm.rdbuf()->storage(), start_pos);
  278. strm.rdbuf()->ensure_max_size();
  279. return strm;
  280. }
  281. /*!
  282. * Invokation operator
  283. */
  284. template< typename ContextT >
  285. typename result< const this_type(ContextT const&) >::type operator() (ContextT const& ctx) const
  286. {
  287. // Flush the stream and keep the current write position in the target string
  288. typedef typename result< const this_type(ContextT const&) >::type result_type;
  289. result_type strm = phoenix::eval(m_left, ctx);
  290. strm.flush();
  291. typename string_type::size_type const start_pos = strm.rdbuf()->storage()->size();
  292. // Invoke the adopted formatter
  293. phoenix::eval(m_subactor, ctx);
  294. // Flush the buffered characters and apply decorations
  295. strm.flush();
  296. m_impl(*strm.rdbuf()->storage(), start_pos);
  297. strm.rdbuf()->ensure_max_size();
  298. return strm;
  299. }
  300. BOOST_DELETED_FUNCTION(char_decorator_output_terminal())
  301. };
  302. } // namespace aux
  303. /*!
  304. * Character decorator terminal class. This formatter allows to modify strings generated by other
  305. * formatters on character level. The most obvious application of decorators is replacing
  306. * a certain set of characters with decorated equivalents to satisfy requirements of
  307. * text-based sinks.
  308. *
  309. * The \c char_decorator_terminal class aggregates the formatter being decorated, and a set
  310. * of string pairs that are used as decorations. All decorations are applied sequentially.
  311. * The \c char_decorator_terminal class is a formatter itself, so it can be used to construct
  312. * more complex formatters, including nesting decorators.
  313. */
  314. template< typename SubactorT, typename ImplT >
  315. class char_decorator_terminal
  316. {
  317. private:
  318. //! Self type
  319. typedef char_decorator_terminal< SubactorT, ImplT > this_type;
  320. public:
  321. #ifndef BOOST_LOG_DOXYGEN_PASS
  322. //! Internal typedef for type categorization
  323. typedef void _is_boost_log_terminal;
  324. #endif
  325. //! Implementation type
  326. typedef ImplT impl_type;
  327. //! Character type
  328. typedef typename impl_type::char_type char_type;
  329. //! String type
  330. typedef typename impl_type::string_type string_type;
  331. //! Stream type
  332. typedef basic_formatting_ostream< char_type > stream_type;
  333. //! Adopted actor type
  334. typedef SubactorT subactor_type;
  335. //! Result type definition
  336. typedef string_type result_type;
  337. private:
  338. //! Adopted formatter actor
  339. subactor_type m_subactor;
  340. //! Implementation
  341. impl_type m_impl;
  342. public:
  343. /*!
  344. * Initializing constructor.
  345. */
  346. char_decorator_terminal(subactor_type const& sub, impl_type const& impl) : m_subactor(sub), m_impl(impl)
  347. {
  348. }
  349. /*!
  350. * Copy constructor
  351. */
  352. char_decorator_terminal(char_decorator_terminal const& that) : m_subactor(that.m_subactor), m_impl(that.m_impl)
  353. {
  354. }
  355. /*!
  356. * \returns Adopted subactor
  357. */
  358. subactor_type const& get_subactor() const
  359. {
  360. return m_subactor;
  361. }
  362. /*!
  363. * \returns Implementation
  364. */
  365. impl_type const& get_impl() const
  366. {
  367. return m_impl;
  368. }
  369. /*!
  370. * Invokation operator
  371. */
  372. template< typename ContextT >
  373. result_type operator() (ContextT const& ctx)
  374. {
  375. string_type str;
  376. stream_type strm(str);
  377. // Invoke the adopted formatter
  378. typedef phoenix::vector3<
  379. subactor_type*,
  380. typename fusion::result_of::at_c<
  381. typename remove_cv<
  382. typename remove_reference<
  383. typename phoenix::result_of::env< ContextT const& >::type
  384. >::type
  385. >::type::args_type,
  386. 0
  387. >::type,
  388. stream_type&
  389. > env_type;
  390. env_type env = { boost::addressof(m_subactor), fusion::at_c< 0 >(phoenix::env(ctx).args()), strm };
  391. phoenix::eval(m_subactor, phoenix::make_context(env, phoenix::actions(ctx)));
  392. // Flush the buffered characters and apply decorations
  393. strm.flush();
  394. m_impl(*strm.rdbuf()->storage());
  395. return BOOST_LOG_NRVO_RESULT(str);
  396. }
  397. /*!
  398. * Invokation operator
  399. */
  400. template< typename ContextT >
  401. result_type operator() (ContextT const& ctx) const
  402. {
  403. string_type str;
  404. stream_type strm(str);
  405. // Invoke the adopted formatter
  406. typedef phoenix::vector3<
  407. const subactor_type*,
  408. typename fusion::result_of::at_c<
  409. typename remove_cv<
  410. typename remove_reference<
  411. typename phoenix::result_of::env< ContextT const& >::type
  412. >::type
  413. >::type::args_type,
  414. 0
  415. >::type,
  416. stream_type&
  417. > env_type;
  418. env_type env = { boost::addressof(m_subactor), fusion::at_c< 0 >(phoenix::env(ctx).args()), strm };
  419. phoenix::eval(m_subactor, phoenix::make_context(env, phoenix::actions(ctx)));
  420. // Flush the buffered characters and apply decorations
  421. strm.flush();
  422. m_impl(*strm.rdbuf()->storage());
  423. return BOOST_LOG_NRVO_RESULT(str);
  424. }
  425. BOOST_DELETED_FUNCTION(char_decorator_terminal())
  426. };
  427. /*!
  428. * Character decorator actor
  429. */
  430. template< typename SubactorT, typename ImplT, template< typename > class ActorT = phoenix::actor >
  431. class char_decorator_actor :
  432. public ActorT< char_decorator_terminal< SubactorT, ImplT > >
  433. {
  434. public:
  435. //! Base terminal type
  436. typedef char_decorator_terminal< SubactorT, ImplT > terminal_type;
  437. //! Character type
  438. typedef typename terminal_type::char_type char_type;
  439. //! Base actor type
  440. typedef ActorT< terminal_type > base_type;
  441. public:
  442. //! Initializing constructor
  443. explicit char_decorator_actor(base_type const& act) : base_type(act)
  444. {
  445. }
  446. //! Returns reference to the terminal
  447. terminal_type const& get_terminal() const
  448. {
  449. return this->proto_expr_.child0;
  450. }
  451. };
  452. #ifndef BOOST_LOG_DOXYGEN_PASS
  453. #define BOOST_LOG_AUX_OVERLOAD(left_ref, right_ref)\
  454. template< typename LeftExprT, typename SubactorT, typename ImplT, template< typename > class ActorT >\
  455. BOOST_FORCEINLINE phoenix::actor< aux::char_decorator_output_terminal< phoenix::actor< LeftExprT >, SubactorT, ImplT > >\
  456. operator<< (phoenix::actor< LeftExprT > left_ref left, char_decorator_actor< SubactorT, ImplT, ActorT > right_ref right)\
  457. {\
  458. typedef aux::char_decorator_output_terminal< phoenix::actor< LeftExprT >, SubactorT, ImplT > terminal_type;\
  459. phoenix::actor< terminal_type > actor = {{ terminal_type(left, right.get_terminal().get_subactor(), right.get_terminal().get_impl()) }};\
  460. return actor;\
  461. }
  462. #include <boost/log/detail/generate_overloads.hpp>
  463. #undef BOOST_LOG_AUX_OVERLOAD
  464. #endif // BOOST_LOG_DOXYGEN_PASS
  465. namespace aux {
  466. template< typename RangeT >
  467. class char_decorator_gen1
  468. {
  469. RangeT const& m_decorations;
  470. typedef typename boost::log::aux::deduce_char_type< typename range_value< RangeT >::type::first_type >::type char_type;
  471. public:
  472. explicit char_decorator_gen1(RangeT const& decorations) : m_decorations(decorations)
  473. {
  474. }
  475. template< typename SubactorT >
  476. BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< char_type > > operator[] (SubactorT const& subactor) const
  477. {
  478. typedef pattern_replacer< char_type > replacer_type;
  479. typedef char_decorator_actor< SubactorT, replacer_type > result_type;
  480. typedef typename result_type::terminal_type terminal_type;
  481. typename result_type::base_type act = {{ terminal_type(subactor, replacer_type(m_decorations)) }};
  482. return result_type(act);
  483. }
  484. };
  485. template< typename FromRangeT, typename ToRangeT >
  486. class char_decorator_gen2
  487. {
  488. FromRangeT const& m_from;
  489. ToRangeT const& m_to;
  490. typedef typename boost::log::aux::deduce_char_type< typename range_value< FromRangeT >::type >::type from_char_type;
  491. typedef typename boost::log::aux::deduce_char_type< typename range_value< ToRangeT >::type >::type to_char_type;
  492. BOOST_STATIC_ASSERT_MSG((is_same< from_char_type, to_char_type >::value), "Boost.Log: character decorator cannot be instantiated with different character types for source and replacement strings");
  493. public:
  494. char_decorator_gen2(FromRangeT const& from, ToRangeT const& to) : m_from(from), m_to(to)
  495. {
  496. }
  497. template< typename SubactorT >
  498. BOOST_FORCEINLINE char_decorator_actor< SubactorT, pattern_replacer< from_char_type > > operator[] (SubactorT const& subactor) const
  499. {
  500. typedef pattern_replacer< from_char_type > replacer_type;
  501. typedef char_decorator_actor< SubactorT, replacer_type > result_type;
  502. typedef typename result_type::terminal_type terminal_type;
  503. typename result_type::base_type act = {{ terminal_type(subactor, replacer_type(m_from, m_to)) }};
  504. return result_type(act);
  505. }
  506. };
  507. } // namespace aux
  508. /*!
  509. * The function returns a decorator generator object. The generator provides <tt>operator[]</tt> that can be used
  510. * to construct the actual decorator.
  511. *
  512. * \param decorations A sequence of string pairs that will be used as decorations. Every <tt>decorations[i].first</tt>
  513. * substring occurrence in the output will be replaced with <tt>decorations[i].second</tt>.
  514. */
  515. template< typename RangeT >
  516. BOOST_FORCEINLINE aux::char_decorator_gen1< RangeT > char_decor(RangeT const& decorations)
  517. {
  518. return aux::char_decorator_gen1< RangeT >(decorations);
  519. }
  520. /*!
  521. * The function returns a decorator generator object. The generator provides <tt>operator[]</tt> that can be used
  522. * to construct the actual decorator.
  523. *
  524. * \param from A sequence of strings that will be sought in the output.
  525. * \param to A sequence of strings that will be used as replacements.
  526. *
  527. * \note The \a from and \a to sequences mush be of the same size. Every <tt>from[i]</tt>
  528. * substring occurrence in the output will be replaced with <tt>to[i]</tt>.
  529. */
  530. template< typename FromRangeT, typename ToRangeT >
  531. BOOST_FORCEINLINE aux::char_decorator_gen2< FromRangeT, ToRangeT > char_decor(FromRangeT const& from, ToRangeT const& to)
  532. {
  533. return aux::char_decorator_gen2< FromRangeT, ToRangeT >(from, to);
  534. }
  535. } // namespace expressions
  536. BOOST_LOG_CLOSE_NAMESPACE // namespace log
  537. #ifndef BOOST_LOG_DOXYGEN_PASS
  538. namespace phoenix {
  539. namespace result_of {
  540. template< typename SubactorT, typename ImplT >
  541. struct is_nullary< custom_terminal< boost::log::expressions::char_decorator_terminal< SubactorT, ImplT > > > :
  542. public mpl::false_
  543. {
  544. };
  545. template< typename LeftT, typename SubactorT, typename ImplT >
  546. struct is_nullary< custom_terminal< boost::log::expressions::aux::char_decorator_output_terminal< LeftT, SubactorT, ImplT > > > :
  547. public mpl::false_
  548. {
  549. };
  550. } // namespace result_of
  551. } // namespace phoenix
  552. #endif
  553. } // namespace boost
  554. #include <boost/log/detail/footer.hpp>
  555. #endif // BOOST_LOG_EXPRESSIONS_FORMATTERS_CHAR_DECORATOR_HPP_INCLUDED_