Hi,

I'm trying to use bood::bind and I'm having a problem with compilation when I'm passing an object that holds a std::stringstream. The errors are to do with std::ios_base and std::streambuf's copy constructors being private, but as far as I knew (and understand from the docs), boost::bind passes by reference, so nothing should be copied. I'm sure I'm missing something fundamental here, so any enlightening would be very welcome.

My setup is gcc 4.1.2 on Ubuntu 6.10. Here's an example program that fails:

#include <sstream>
#include <boost/bind.hpp>
#include <boost/thread.hpp>

using namespace boost; // sorry
using namespace std;     // oops


struct holder
{
std::ostringstream oss;
};

void sub_main( holder& h )
{
    return;
}

class event_handler
{
public:
    void operator() ( holder& h )
    {
        thread t( bind( &sub_main, h ) );
        t.join();
    }
};

int main( int, char** )
{
    event_handler e_h;
    holder h;

    e_h(h);

    return 0;
}

Regards,
Darren