12 Oct 23:49
return type of boost::iostreams::stream<T>::read()
From: Struebing, Axel, le-tex <axel.struebing <at> le-tex.de>
Subject: return type of boost::iostreams::stream<T>::read()
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-10-12 21:53:18 GMT
Subject: return type of boost::iostreams::stream<T>::read()
Newsgroups: gmane.comp.lib.boost.user
Date: 2008-10-12 21:53:18 GMT
I apologize, if i have missed something.
Reading the documentation about boost::iostreams library I could not find the
information which return type the boost::iostreams::stream's class is giving
me calling read(). I searched through the headers and every read() found
returns std::streamsize, which sounds reasonable to me.
I was surprised, that the code below does not compile
--------start code ----------
#include <boost/iostreams/stream.hpp>
#include <boost/iostreams/device/file.hpp>
int main(void){
boost::iostreams::stream<boost::iostreams::file_source>
istr(std::string("in.pdf"));
char *buffer = new char[10];
std::streamsize i = istr.read(buffer,10);
return 0;
}
-------end code-----------
and gives me:
test.cpp:7: error: invalid conversion from ‘void*’ to ‘std::streamsize’
Could someone shed a light on me, please?
Thanks in advance.
kind regards
Axel
(Continue reading)
RSS Feed