boost::log::formatters::fmt_chain — A formatter compound that encapsulates two other formatters.
// In header: <boost/log/formatters/chain.hpp> template<typename CharT, typename LeftFmtT, typename RightFmtT> class fmt_chain : public basic_formatter< CharT, fmt_chain< CharT, LeftFmtT, RightFmtT > > { public: // types typedef base_type::ostream_type ostream_type; // Stream type. typedef base_type::record_type record_type; // Log record type. // construct/copy/destruct template<typename RightT> fmt_chain(LeftFmtT const &, RightT const &); // public member functions void operator()(ostream_type &, record_type const &) const; };
The formatting lambda expressions are decomposed by compiler into a sequence of binary operators. This formatter does nothing but to connect two other formatters that participate in such an expression. When invoked, the formatter simply calls its first (or left-hand) aggregated formatter and then calls its second (right-hand) formatter.
Chaining formatters can be composed into trees which allows to construct arbitrary-sized formatting lambda expressions.