Boost logo

Boost :

From: Dirk Griffioen (dirkgriffioen_at_[hidden])
Date: 2005-03-23 07:16:28


Hi Jonathan,

Thanks for helping me out!!

I've tried your proposition below and it does the trick, even with
actual encryption going on:

out << "test" << std::endl; //this works
//out << "test" << "\n"; //this does not

One remark: he code above works on my vc71 debug setup (cl called
through bjam v2 build v10), but if I read your earlier mail correctly it
should be the other way around and hang as well?

One question: is this behaviour intended?

I will try some more stuff (with some other containers , the copy/adapt
etc) and source/sink - apart from encryption I am in need of a audio
source/sink.

I'll let you know :) - It's great stuff!

Cheers, Dirk

(Sorry the code didn't compile, forgot to match the filter names).

(And what do you mean by 'red herring' ? :)

-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Jonathan Turkanis
Sent: Tuesday 22 March 2005 22:32
To: boost_at_[hidden]
Subject: [boost] Re: boost::iostreams: only with std::cout?

Dirk Griffioen wrote:

> I would love to use the boost::iostreams lib, so I created a filter
> (which, in this case, does encryption)
>
> but instead of passing it std::cout I would like to pass it some other
> stream, a stringstream for instance (or any kind of ostream/istream,
> depending on the direction).

> However, I was very surprised to find the following code taking 100%
> cpu and not returning. It probably means I did something wrong, but I
> can't seem to find it.

Here's a cleaned up example that reproduces the bug (when endl is
replaces by
"\n"). It seems the filter is a red herring.

Jonathan

#include <iostream>
#include <sstream>
#include <boost/iostreams/filtering_stream.hpp>

int main()
{
    boost::iostreams::filtering_ostream out;
    std::ostringstream os;
    out.push(os);
    out << "test" << std::endl;
    //out << "test" << "\n";
    std::cout << os.str();
}

_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed.

If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited.

If you have received this email in error please notify
our system management at postmaster_at_[hidden] and immediately and permanently delete this message and any attachments.

********************************************


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk