Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r49871 - trunk/boost/interprocess/containers
From: igaztanaga_at_[hidden]
Date: 2008-11-22 05:48:18


Author: igaztanaga
Date: 2008-11-22 05:48:17 EST (Sat, 22 Nov 2008)
New Revision: 49871
URL: http://svn.boost.org/trac/boost/changeset/49871

Log:
Fixed bug in optimized allocator insertion. Empty range insertion was not checked.
Text files modified:
   trunk/boost/interprocess/containers/list.hpp | 8 +++++---
   1 files changed, 5 insertions(+), 3 deletions(-)

Modified: trunk/boost/interprocess/containers/list.hpp
==============================================================================
--- trunk/boost/interprocess/containers/list.hpp (original)
+++ trunk/boost/interprocess/containers/list.hpp 2008-11-22 05:48:17 EST (Sat, 22 Nov 2008)
@@ -1283,9 +1283,11 @@
    void priv_create_and_insert_nodes
       (const_iterator pos, FwdIterator beg, FwdIterator end, allocator_v2, std::forward_iterator_tag)
    {
- //Optimized allocation and construction
- this->allocate_many_and_construct
- (beg, std::distance(beg, end), insertion_functor(this->icont(), pos.get()));
+ if(beg != end){
+ //Optimized allocation and construction
+ this->allocate_many_and_construct
+ (beg, std::distance(beg, end), insertion_functor(this->icont(), pos.get()));
+ }
    }
 
    //Default constructed version


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk