Boost logo

Boost :

Subject: Re: [boost] [Containers] How about a list with O(1) splice?
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-10-06 18:08:52


on Thu Oct 06 2011, Olaf van der Spek <ml-AT-vdspek.org> wrote:

> On Thu, Oct 6, 2011 at 9:44 PM, Dave Abrahams <dave_at_[hidden]> wrote:
>>
>
>> on Thu Oct 06 2011, Olaf van der Spek <ml-AT-vdspek.org> wrote:
>>
>>> On Thu, Oct 6, 2011 at 8:50 PM, Dave Abrahams <dave_at_[hidden]> wrote:
>>>>> Wouldn't it be a logic_error? An assert seems more appropriate.
>>>>
>>>> That's my point.  IMO we shouldn't throw in response to conditions that
>>>> are almost certainly programming errors.
>>>
>>> assert() works only in NDEBUG builds. What options besides throwing
>>> does one have?
>>
>> BOOST_ASSERT().
>
> That's a no-op when NDEBUG is defined, just like assert().

And that's a problem because...?

I repeat: undefined behavior is called for here.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk