Posted on 2007-03-01 14:47 by Timo at Permlink with Comments. Tags: std::string std::ostream printable c++ code-snippet
How to get a custom class to work with std::cout << obj; ? I for my part always forget the exact prototype of the required operator<<. Here is an minimal working example to copy code from:
Comment by bryane at 2007-04-27 17:49 UTC
it is perhaps better to make a pass-thru template to avoid most of the typing: