Boost logo

Boost Users :

Subject: Re: [Boost-users] Serializing UUIDs into text archives
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-03-07 00:42:27


Matthias Vallentin wrote:
> Serializing a UUID into a boost::archive::binary_[io]archive works
> fine. However, when changing to a text archive, I get a compiler
> error with
> gcc 4.7 in C++11 mode on Darwin. Here is a small example:
>
> #include <boost/archive/text_oarchive.hpp>
> #include <boost/iostreams/device/back_inserter.hpp>
> #include <boost/iostreams/filtering_stream.hpp>
> #include <boost/uuid/uuid_generators.hpp>
> #include <boost/uuid/uuid_serialize.hpp>
>
> int main()
> {
> std::vector<char> v;
> boost::iostreams::filtering_ostream
> stream(boost::iostreams::back_inserter(v));
> boost::archive::text_oarchive oa(stream);
>
> const boost::uuids::uuid id = boost::uuids::random_generator()();
> // try adding const here !!
> oa << id;
>
> return 0;
> }
>
> The error is in basic_text_oprimitive line 92:
>
> cannot bind 'std::basic_ostream<char>' lvalue to
> 'std::basic_ostream<char>&&'
>
> Any ideas what's going on? (I attached the full error message below.)
>
> Matthias
>

Robert Ramey


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