Boost C++ Libraries 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 to view this page for the latest version.

Function template operator<<

boost::logic::operator<< — Writes the value of a tribool to a stream.


// In header: <boost/logic/tribool_io.hpp>

template<typename CharT, typename Traits> 
  std::basic_ostream< CharT, Traits > & 
  operator<<(std::basic_ostream< CharT, Traits > & out, tribool x);


When the value of x is either true or false, this routine is semantically equivalent to:

out << static_cast<bool>(x); 

When x has an indeterminate value, it outputs either the integer value 2 (if (out.flags() & std::ios_base::boolalpha) == 0) or the name of the indeterminate value. The name of the indeterminate value comes from the indeterminate_name facet (if it is defined in the output stream's locale), or from the get_default_indeterminate_name function (if it is not defined in the locale or if the C++ standard library implementation does not support locales).