Boost C++ Libraries: Ticket #791: iostreams::tee_filter is for output only https://svn.boost.org/trac10/ticket/791 <pre class="wiki">I faught the C++ compiler for a little while before I realized that the iostreams::tee_filter was written as an output filter only. I needed it to work for an input chain and I do not see why there is such a limitation. My idea is to catch a copy of the data somewhere in the chain before it gets transformed further. Whether it is input our output it should work, right? (at least in theory...) Anyone has input in that regard? Thank you, Alexis Wilke </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/791 Trac 1.4.3 alexis_wilke Mon, 11 Dec 2006 08:31:55 GMT <link>https://svn.boost.org/trac10/ticket/791#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/791#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=554061 Originator: YES I propose the following additional function and adding multichar_input_filter_tag to the category. My software seems to work just fine with this addition. template&lt;typename Source&gt; std::streamsize read(Source&amp; src, char_type* s, std::streamsize n) { int c; char_type* first = s; char_type* last = s + n; while ( first != last &amp;&amp; (c = boost::iostreams::get(src)) != EOF &amp;&amp; c != WOULD_BLOCK ) { *first++ = c; } std::streamsize result = static_cast&lt;std::streamsize&gt;(first - s); if(result == 0) { return c; } std::streamsize result2 = iostreams::write(this-&gt;component(), s, result); (void) result2; // Suppress 'unused variable' warning. assert(result == result2); return result; } </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Daryle Walker</dc:creator> <pubDate>Fri, 03 Aug 2007 12:18:00 GMT</pubDate> <title>component changed; severity set https://svn.boost.org/trac10/ticket/791#comment:2 https://svn.boost.org/trac10/ticket/791#comment:2 <ul> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iostreams</span> </li> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket Jonathan Turkanis Sun, 30 Dec 2007 08:44:17 GMT type changed; milestone set https://svn.boost.org/trac10/ticket/791#comment:3 https://svn.boost.org/trac10/ticket/791#comment:3 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Feature Requests</span> </li> <li><strong>milestone</strong> → <span class="trac-field-new">Boost 1.36.0</span> </li> </ul> <p> When I wrote tee, I couldn't think of a way to apply the concept to an input stream, but your idea looks pretty good. I will consider it for 1.36. </p> Ticket Jonathan Turkanis Sun, 25 May 2008 22:03:23 GMT status, resolution changed https://svn.boost.org/trac10/ticket/791#comment:4 https://svn.boost.org/trac10/ticket/791#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/45752" title="made tee work with input streams (fixes #791)">[45752]</a>) made tee work with input streams (fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/791" title="#791: Feature Requests: iostreams::tee_filter is for output only (closed: fixed)">#791</a>) </p> Ticket