c++ translate ostream operator to function call

94 views Asked by At

I feel there should be a single liner with boost::phoenix that would let me stream an object having a member function ...::stream_to(std::ostream&) with << syntax. Something like this:

struct x { void stream_to(std::ostream&); }
LOG_INFO << MAGIC_SOMETHING(x);

But struggling to find that MAGIC_SOMETHING(...). Am specifically interested in a solution that won't require me doing a forwarding marker struct and ostream operator for it.

0

There are 0 answers