Dv::iomanip_m< T > Struct Template Reference
Convert typical member functions to iomanip objects that can be put on a stream using the conventional operator<<.
More...
#include <iomanip.h>
List of all members.
Detailed Description
template<typename T>
struct Dv::iomanip_m< T >
Convert typical member functions to iomanip objects that can be put on a stream using the conventional operator<<.
This is version uses the member function directly. However, contrary to Dv::iomanip, it does not directly support virtual member functions. Typical usage example:
struct C {
virtual std::ostream print_summary(std::ostream& os) const {
..
}
Dv::iomanip_m<C> summary() const {
return Dv::iomanip<C>(&C::*print_summary, *this);
}
};
C c;
std::cout << "foobar: " << c.summary() << std::endl;
The above does not easily works when subclassing, unlike the approach that uses a static intermediate function.
- See also:
- Dv::iomanip
Definition at line 105 of file iomanip.h.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Data Documentation
The documentation for this struct was generated from the following file: