Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Automatically use custom string conversion in C++ stream output.
This diagnostics facility allows just to dump any object into cout
or cerr
. Pointers will be detected, checked for NULL and printed as address, followed by the representation of the pointee. When the displayed entity defines an operator string()
, this custom string conversion will be used (suppressing any exceptions, of course). As fallback, a simplified type string is printed.
ostream
inserter; in a modern GUI application, there isn't much use for STDOUT and STDERR, beyond error messages and unit testing. Thus, we can strive at building a more convenient flavour here, which does indeed even show the address of pointers.Definition in file format-cout.hpp.
Typedefs | |
template<typename X > | |
using | enable_StringConversion = lib::meta::enable_if< lib::meta::use_StringConversion4Stream< X > > |
Functions | |
template<typename _CharT , typename _Traits , typename X , typename = enable_StringConversion<X>> | |
basic_ostream< _CharT, _Traits > & | operator<< (basic_ostream< _CharT, _Traits > &os, X const &obj) |
generic overload to use custom string conversions in output | |
template<typename _CharT , typename _Traits , typename X , typename = enable_StringConversion<X>> | |
basic_ostream< _CharT, _Traits > & | operator<< (basic_ostream< _CharT, _Traits > &os, X const *ptr) |
generic overload to pretty-print any pointer in output More... | |
Namespaces |
|
inline |
generic overload to pretty-print any pointer in output
Definition at line 84 of file format-cout.hpp.