Boost logo

Boost Users :

From: Benjamin A. Collins (ben.collins_at_[hidden])
Date: 2007-03-01 13:16:59


I'm trying to use iostreams::mapped_file as a source for a
iostreams::filtered_istream, and it's not quite working out.

I create my chain like this:

boost::iostreams::filtered_istream in;
in.push(boost::iostreams::zlib_decompressor());
in.push(boost::iostreams::mapped_file("some file name")); // error here

I haven't dug too deeply yet because I'm hoping this is not new or
obscure.

gcc 3.3.5 on OpenBSD 3.9 reports the following error:

[03.01.07 12:13:28 bc_at_qui-gon libgit++]$ scons tools
Skipping checks...
g++ -Wall -Werror -fno-builtin -g -O0 -fno-default-inlines -DVERSION="0.0.4" -I/usr/local/include/boost-1_33_1 -Isrc -c -o src/myprogram.o src/myprogram.cpp
/usr/local/include/boost-1_33_1/boost/iostreams/optimal_buffer_size.hpp: In
   function `streamsize boost::iostreams::optimal_buffer_size(const T&) [with T
   = boost::iostreams::mapped_file]':
/usr/local/include/boost-1_33_1/boost/iostreams/chain.hpp:236: instantiated from `void boost::iostreams::detail::chain_base<Self, Ch, Tr, Alloc, Mode>::push_impl(const T&, int, int) [with T = boost::iostreams::mapped_file, Self = boost::iostreams::chain<boost::iostreams::input, char, std::char_traits<char>, std::allocator<char> >, Ch = char, Tr = std::char_traits<char>, Alloc = std::allocator<char>, Mode = boost::iostreams::input]'
/usr/local/include/boost-1_33_1/boost/iostreams/chain.hpp:179: instantiated from `void boost::iostreams::detail::chain_base<Self, Ch, Tr, Alloc, Mode>::push(const T&, int, int, typename boost::disable_if<boost::iostreams::is_std_io<T>, void>::type*) [with T = boost::iostreams::mapped_file, Self = boost::iostreams::chain<boost::iostreams::input, char, std::char_traits<char>, std::allocator<char> >, Ch = char, Tr = std::char_traits<char>, Alloc = std::allocator<char>, Mode = boost::iostreams::input]'
/usr/local/include/boost-1_33_1/boost/iostreams/chain.hpp:484: instantiated from `void boost::iostreams::detail::chain_client<Chain>::push_impl(const T&, int, int) [with T = boost::iostreams::mapped_file, Chain = boost::iostreams::chain<boost::iostreams::input, char, std::char_traits<char>, std::allocator<char> >]'
/usr/local/include/boost-1_33_1/boost/iostreams/chain.hpp:472: instantiated from `void boost::iostreams::detail::chain_client<Chain>::push(const T&, int, int, typename boost::disable_if<boost::iostreams::is_std_io<T>, void>::type*) [with T = boost::iostreams::mapped_file, Chain = boost::iostreams::chain<boost::iostreams::input, char, std::char_traits<char>, std::allocator<char> >]'
src/myprogram.cpp:27: instantiated from here
/usr/local/include/boost-1_33_1/boost/iostreams/optimal_buffer_size.hpp:38: error: '
   struct
   boost::iostreams::detail::optimal_buffer_size_impl<boost::iostreams::mapped_file>
   ' has no member named 'optimal_buffer_size'
scons: *** [src/myprogram.o] Error 1

-- 
Benjamin Collins
ben.collins_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net