[iostreams] calling sink member function

Hi, The following used to compile with MinGW GCC 3.4.2: <code> #include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream_facade.hpp> #include <iostream> class my_sink : public boost::iostreams::sink { public: std::streamsize write(char const *, std::streamsize size) { return size; } void foo() { std::cout << "foo() called" << std::endl; } }; int main() { boost::iostreams::stream_facade<my_sink> out; out->foo(); return 0; } </code> Now I get the following error: E:/libs/boost/boost/iostreams/stream_facade.hpp: In member function `my_sink * boost::iostreams::stream_facade<my_sink, char_traits<char> > ::operator->()': boost_iostreams_issues.cpp:36: instantiated from here E:/libs/boost/boost/iostreams/stream_facade.hpp:119: error: no match for 'operator *' in '*( ( ( boost::base_from_member< boost::iostreams::streambuf_facade< my_sink, char_traits<char>, boost::iostreams::output >, 0 > * )( (boost::iostreams::stream_facade<my_sink, char_traits<char> > * )this ) ) + 4u )->boost::base_from_member< boost::iostreams::streambuf_facade< my_sink, char_traits<char>, boost::iostreams::output >, 0 >::member' It compiles if I remove the call to foo(). What must I do to make it work again? Thanks, -- Daniel Schlyder http://bitblaze.com/

Daniel Schlyder wrote:
Hi,
The following used to compile with MinGW GCC 3.4.2:
<code> #include <boost/iostreams/concepts.hpp> #include <boost/iostreams/stream_facade.hpp>
#include <iostream>
class my_sink : public boost::iostreams::sink { public:
std::streamsize write(char const *, std::streamsize size) { return size; }
void foo() { std::cout << "foo() called" << std::endl; } };
int main() { boost::iostreams::stream_facade<my_sink> out;
out->foo();
return 0; } </code>
I'm embarassed to say I removed this accidentally. You can do: out.component()->foo(). But I'll restore the previous syntax ASAP. Jonathan

Jonathan Turkanis:
I'm embarassed to say I removed this accidentally. You can do:
out.component()->foo().
But I'll restore the previous syntax ASAP.
Looking forward to it. Thanks. -- Daniel Schlyder http://bitblaze.com/
participants (2)
-
Daniel Schlyder
-
Jonathan Turkanis