Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82075 - sandbox/static_vector/boost/container
From: adam.wulkiewicz_at_[hidden]
Date: 2012-12-18 07:42:13


Author: awulkiew
Date: 2012-12-18 07:42:13 EST (Tue, 18 Dec 2012)
New Revision: 82075
URL: http://svn.boost.org/trac/boost/changeset/82075

Log:
Fixed errors.
Text files modified:
   sandbox/static_vector/boost/container/static_vector.hpp | 18 ++++++++++--------
   1 files changed, 10 insertions(+), 8 deletions(-)

Modified: sandbox/static_vector/boost/container/static_vector.hpp
==============================================================================
--- sandbox/static_vector/boost/container/static_vector.hpp (original)
+++ sandbox/static_vector/boost/container/static_vector.hpp 2012-12-18 07:42:13 EST (Tue, 18 Dec 2012)
@@ -260,18 +260,16 @@
         {
             for (; it != this->end() ; ++it, ++other_it)
                 boost::swap(*it, *other_it); // may throw
- this->insert(it,other_it,other->end()); // may throw
+ this->insert(it, other_it, other.end()); // may throw
             other.erase(other_it, other.end());
         }
         else
         {
             for (; other_it != other.end() ; ++it, ++other_it)
                 boost::swap(*it, *other_it); // may throw
- other->insert(other_it,it,this->end()); // may throw
+ other.insert(other_it,it,this->end()); // may throw
             this->erase(it, this->end());
         }
-
- boost::swap(m_size, other.m_size);
     }
 
     // strong
@@ -340,13 +338,17 @@
         errh::check_iterator_end_eq(*this, position);
         errh::check_capacity(*this, m_size + 1); // may throw
 
- this->uninitialized_fill(this->end(), *(this->end() - 1)); // may throw
- ++m_size; // update end
-
- if ( position != this->end() )
+ if ( position == this->end() )
+ {
+ this->uninitialized_fill(position, value); // may throw
+ ++m_size; // update end
+ }
+ else
         {
             // TODO - should following lines check for exception and revert to the old size?
 
+ this->uninitialized_fill(this->end(), *(this->end() - 1)); // may throw
+ ++m_size; // update end
             this->move_backward(position, this->end() - 2, this->end() - 1); // may throw
             this->fill(position, value); // may throw
         }


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