Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Function template optional_manip

boost::log::optional_manip

Synopsis

// In header: <boost/log/utility/manipulators/optional.hpp>


template<typename OptionalT, typename NoneElementT, std::size_t N> 
  boost::enable_if_c< is_scalar< OptionalT >::value, optional_manipulator< OptionalT, NoneElementT * >>::type 
  optional_manip(OptionalT opt, NoneElementT(&) none);

Description

Optional manipulator generator function.

[Note] Note

Both opt and none objects must outlive the created manipulator object.

Parameters:

none

Marker used to indicate when the value is not present. Optional. If not specified, nothing is output if the value is not present.

opt

Optional value to output. The optional value must support contextual conversion to bool and dereferencing, and its dereferencing result must support stream output.

Returns:

Manipulator to be inserted into the stream.


PrevUpHomeNext