30namespace triqs::utility {
45 std::function<bool()> condition;
54 debug_stream(std::ostream *out_, std::function<
bool()> condition) : out(out_), condition(condition) {}
71 if (condition && condition()) (*out) << x;
77 using CoutType = std::basic_ostream<char, std::char_traits<char>>;
90 if (condition && condition()) manip(*out);
debug_stream & operator<<(T const &x)
Write an object to the underlying ostream if the condition() holds and TRIQS_DEBUG is defined.
debug_stream & operator<<(StandardEndLine manip)
Overload of operator<<() that accepts manipulators like std::endl.
debug_stream(std::ostream *out_)
Construct a debug stream without a condition.
debug_stream(std::ostream *out_, std::function< bool()> condition)
Construct a debug stream with a condition predicate.
CoutType &(*)(CoutType &) StandardEndLine
Type of standard manipulators like std::endl.
std::basic_ostream< char, std::char_traits< char > > CoutType
Output stream type.