Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-02 20:49:34


"Rani Sharoni" <rani_sharoni_at_[hidden]> writes:

> David Abrahams wrote:
>> "Rani Sharoni" <rani_sharoni_at_[hidden]> writes:
>>
>>> I can't really understand the invariants of the basic_format class
>>> but I suspect that its copy assignment operator has exceptions
>>> safety issue. In case that the operator= is exception safe then it
>>> only provides the basic guarantee and I wondered if it's was
>>> intentional?
>>> Anyway, AFAIKT this function can easily provide the strong guarantee
>>> using the usual swap idiom without any drawback.
>>
>> The "usual swap" idiom has "usual" drawbacks. Why are they
>> inapplicable in this case? Strong assignment can always be built on
>> basic assignment after-the-fact.
>
> I explicitly talked about this case in which the throwing operations are the
> two std::vector assignments. Do you agree that this specific assignment
> operator is not exception safe

I don't know enough about the implementation of basic_format to make
a judgement. You are correct to ask about the invariants, though.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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