metatest::to_stream

Synopsis

template <class T>
struct to_stream
{
  static std::ostream& run(std::ostream& o_);
};

Description

Tool for pretty-printing types at runtime. It takes the type as a compile-time and the stream to print it to as a runtime argument. Pretty-printing support for new types can be added by specialising this template and providing the run method in the specialisation.

#include <metatest/to_stream.hpp>

Example

int main()
{
  to_stream<const int**>::run(std::cout);
}

[up]