Boost C++ Libraries

PrevUpHomeNext

Class template fmt_wrapper<CharT, reference_wrapper< T >>

boost::log::formatters::fmt_wrapper<CharT, reference_wrapper< T >> — Specialization to put objects into streams by reference.

Synopsis

// In header: <boost/log/formatters/wrappers.hpp>

template<typename CharT, typename T> 
class fmt_wrapper<CharT, reference_wrapper< T >> : public basic_formatter< CharT, fmt_wrapper< CharT, reference_wrapper< T > > >
{
public:
  // types
  typedef base_type::ostream_type ostream_type;  // Stream type. 
  typedef base_type::record_type  record_type;   // Log record type. 

  // public member functions
   fmt_wrapper(reference_wrapper< T > const &);
  void operator()(ostream_type &, record_type const &) const;
};

Description

The specialization allows to put into the formatting stream external (with regard to the formatter) objects.

fmt_wrapper public member functions

  1.  fmt_wrapper(reference_wrapper< T > const & obj);

    Constructor

    Parameters:
    obj

    Object to be referenced

  2. void operator()(ostream_type & strm, record_type const &) const;

    Formatting operator. Puts the referenced object into the strm stream.

    Parameters:
    strm

    A reference to the stream, where the final text of the logging record is composed


PrevUpHomeNext