Boost logo

Boost :

Subject: Re: [boost] merge to master?
From: Robert Ramey (ramey_at_[hidden])
Date: 2016-03-05 15:01:02

On 3/5/16 10:51 AM, John Maddock wrote:
>>> I still see a few issues:
>>> * The program iterator_test.cpp aborts when it tries to increment an
>>> out-of-range vector iterator with msvc (14 and 12).
>> I see this on the test matrix, but I haven't been able to reproduce it
>> locally.
> That's weird, it's easily reproducible for me with VC14 x86 debug mode.

LOL - It might be for me as well if I had MSVC installed.

> In the test case you have:
> std::vector<wchar_t> la2;
> {
> typedef
> boost::archive::iterators::wchar_from_mb<std::vector<char>::const_iterator>
> translator;
> std::copy(
> translator(a.begin()),
> translator(a.end()), // bug here
> std::back_inserter(la2)
> );
> The call to translator(a.end()) leads to wchar_from_mb.hpp:137:
> typename boost::iterators::iterator_reference<Base>::type c =
> *(this->base_reference()++);
> Where an attempt is made to dereference and increment the result of the
> previous call to end().

OK - this is very helpful.

> The issue was that constructing an input archive from a std::ifstream
> dies if there's a peek() on the stream prior to the archive
> constructor. I suspect this is due to the calls to imbue() in the
> archive constructor invalidating the stream buffer and the fstream then
> gets it's internals in a twist.

Also very helpful. Thanks for this.

Thinking about this though. In the tests the sequence is

construct stream
construct archive(stream) // call imbue here

But the stream buffer has just been constructed! How could imbue be
called at any earlier time!

I'll look into this again though.

Robert Ramey

> HTH, John.
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at