Boost logo

Ublas :

Subject: [ublas] iostreams spaces are not used
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2011-07-27 06:06:10


Hello,

I'm using iostreams for developing my own filter.

I use this code:

namespace io = boost::iostreams;

int main(int argc, char* argv[]) {
  
    io::filtering_streambuf< io::output > out;

    //out.push(tools::iostreams::urlencoder()); <= this should be my own filter later
    out.push( std::cout );
    
    std::istringstream l_sstream( "abcd_ efgh tjg abc* xxxx");
    std::copy( std::istream_iterator<char>(l_sstream), std::istream_iterator<char>(), std::ostreambuf_iterator<char>(&out) );

    return 0;
}

If I run this little code, on the std::cout I see only this output "abcd_efghtjgabc*xxxx" (spaces are removed). The same problem is within my
filter, I don't get any spaces. I use Boost 1.47.0. Can anybody help me to solve the problem so that all character in my input stream are
detected and be written to the output?

Thanks

Phil