Boost logo

Boost Users :

Subject: Re: [Boost-users] Compress to buffer
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2014-01-16 17:03:41


On 16/01/2014 17:08, Quoth Kenneth Adam Miller:
> Also, supposing I go with something like vector<int64_t> or something,

Why would you? Unless you can guarantee that you're always going to get
a multiple of 8 bytes after compression, that seems like asking for trouble.

> how do I create a device to make the filtering stream complete? I had:
> fos->push(boost::iostreams::back_insert_device<string>(*x));
> now I need to do:
> fos->push(boost::iostreams::back_insert_device<vector<int64_t>>(*x));
> but it complains with "error: no matching function for call to"
> construct it, and then says that it wants one of a ton of different
> valid things, but it template expands all of them so it's a bunch of text...

Your ostream is templated on char, therefore it produces chars. You
can't just insert a char into a vector of int64s.


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