Boost logo

Boost Users :

Subject: Re: [Boost-users] [Container] --begin() on empty deque crashes
From: TONGARI (tongari95_at_[hidden])
Date: 2013-01-19 23:23:46


2013/1/20 Ion Gaztañaga <igaztanaga_at_[hidden]>

> El 19/01/2013 13:06, TONGARI escribió:
>
> Hi there,
>>
>> The code below would simply crash on g++ 4.7.1/MinGW with default
>> optimization level, it doesn't shown with -O/1/2/3
>> ------------------------------**----------
>> boost::container::deque<int> d;
>> --d.begin();
>> ------------------------------**----------
>>
>
> The problem is that decrementing a begin iterator is not a valid operator,
> since it would point out of the container.
>

But wouldn't it be a valid operation as long as we don't dereference from
it?



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