libcwd: The C++ Debugging Support Library - Reference Manual
Author: Carlo Wood
Description: C++ debugging support library with ostream debug output
Keywords: libcwd, debug output, debug facility, debug channel, object orientation, OO, C++, nested debug output, ostream, memory allocation, debugging, source file and line number

Main Page Reference Manual Namespace List Compound List Namespace Members Compound Members File Members

# libcwd::cwprint_using Interface Reference
[Special Functions And Utilities]

Print an object to an ostream using an arbitrary method of that object. More...

`#include <libcwd/cwprint.h>`

## Detailed Description

Print an object to an ostream using an arbitrary method of that object.

This utility can be used to print an object to a debug stream without using the normal `operator<<` of that object (if any exists at all). The purpose is to allow the printing of objects to debug streams in a different way then when you'd normally print them to say `std::cout`.

The object (see example below) must have the signature:

     class Class {
       ...
     public:
       void arbitrary_method_name(std::ostream& os) const;
     };

See also:
  cwprint

Example:

     Dout( dc::channel, cwprint_using(object, &Class::arbitrary_method_name) );

this will write object to the debug stream by calling the method arbitrary_method_name.