Function Dune::XT::Common::print

Function template Dune::XT::Common::print

template<class T>
Printer<T, false> Dune::XT::Common::print(const T&, const Configuration& = {})

The purpose of print(obj) is to provide a flexible and customizable means of modifying the behaviour of printing an object to a stream, without conflicting with implementations of operator < < for obj, which are often beyond the reach of the user. Can be used as in: std::cout < < print(complicated_object, {“tabular”, “true”}) < < std::endl; The output can be determined by specializing Printer , which keeps a reference to complicated_object and a Configuration({“tabular”, “true”}), which can be used by the implementor to customize the output. Defaults to std::cout < < complicated_object < < std::endl; if operator < < is available for complicated_object and no specialization of Printer is found.

See also: Printer, repr