22 Mar
2008
22 Mar
'08
3:40 p.m.
AMDG Robert Dailey wrote:
How about Boost.Bind? Could I use it to bind my operator? I would also expect it to choose the correct overload of the stream operator depending on the type of _1. I have not used Bind like this before, so I'm not sure if it is capable. If all else fails you've given me 2 alternatives concerning Boost.Lambda, so I could always go with that.
To use bind you would have to wrap the stream operator in a function object. struct stream_operator { typedef Stream& result_type; Stream& operator()(Stream& stream, char ch) const { return(stream << ch); } }; ... boost::bind(stream_operator(), stream, _1); In Christ, Steven Watanabe