id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 8315,tee function template does not work for std streams,Claudio Bley,Jonathan Turkanis,"= General Info = OS:: Windows 7 64bit Compiler:: MSVC 10 = The Code = {{{ #!cpp std::ostringstream out; boost::iostreams::tee(out); }}} = Compiler Output / Error = {{{ Boost\Boost_1_53\boost/iostreams/tee.hpp(208): error C2440: '' : cannot convert from 'const std::ostringstream' to 'boost::iostreams::tee_filter' with [ Device=std::ostringstream ] No constructor could take the source type, or constructor overload resolution was ambiguous recurse.cpp(14) : see reference to function template instantiation 'boost::iostreams::tee_filter boost::iostreams::tee(const Sink &)' being compiled with [ Device=std::ostringstream, Sink=std::ostringstream ] }}} = Analysis = The parameter is given to the tee function template as a const-reference: {{{ #!cpp template tee_filter tee(const Sink& snk) { return tee_filter(snk); } }}} Quoting the documentation: The function parameter is a non-const reference if Sink is a stream or stream buffer type, and a const reference otherwise. Actually, this really does not apply to the function parameter, but rather to the tee_filter ctor parameter. So, this boils down to passing a const-reference type to a non-const-reference type as an argument. = Proposed Solution = Remove the ""const"" qualifier from the tee function parameter(s).",Bugs,closed,To Be Determined,iostreams,Boost 1.53.0,Problem,fixed,tee iostreams,