Boost logo

Boost :

Subject: Re: [boost] static_vector using aligned_storage
From: Nevin Liber (nevin_at_[hidden])
Date: 2012-12-12 12:06:20


On 12 December 2012 10:49, Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>wrote:

>
> I don't see a way to implement non-throwing swap since I don't want to use
> some external storage.

It should be non-throwing if the underlying T has a non-throwing move or
copy constructor.

> So swap probably won't be implemented - just copy.
>

If you can, make the interface as close as possible to C++11 std::vector
(well, maybe not vector<bool>, but other than that...). I would do swap
even if it can throw; only provide the basic guarantee if it does throw.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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