문제

I try to make a module of compression/decompression and then use istringstream for compression and ostringstream for decompression.

My problem is that after filling my istringstream with compression datas, I'm not able to convert this stream into an ostringstream. I try :

iss.rdbuf(oss.rdbuf());

as the in and out type match but it doesn't work.

Do you have any idea ?

Thank in advance.

도움이 되었습니까?

해결책

stringstream::rdbuf doesn't have an overload that takes a parameter. It does, however, inherit the base class version which does have this property:

iss.basic_ios<char>::rdbuf(oss.rdbuf());

The fact that you couldn't use it originally is because the derived class version hides it.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top