Function Dune::XT::Common::repr¶
-
template<class T>
int Dune::XT::Common::repr(const T &value, const Configuration ¶m = {})¶ The purpose of repr(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.