From dd018538818aeab3c2e30c987a841e8d35c4eea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Fri, 15 Aug 2014 18:13:05 +0200 Subject: [PATCH] Erased tab & removed unneeded clear() in assignment --- include/boost/container/stable_vector.hpp | 16 +++++++--------- test/stable_vector_test.cpp | 3 +++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/include/boost/container/stable_vector.hpp b/include/boost/container/stable_vector.hpp index d414e25..ef97482 100644 --- a/include/boost/container/stable_vector.hpp +++ b/include/boost/container/stable_vector.hpp @@ -643,10 +643,10 @@ class stable_vector stable_vector(std::initializer_list il, const allocator_type& l = allocator_type()) : internal_data(l), index(l) { - stable_vector_detail::clear_on_destroy cod(*this); - insert(cend(), il.begin(), il.end()) - STABLE_VECTOR_CHECK_INVARIANT; - cod.release(); + stable_vector_detail::clear_on_destroy cod(*this); + insert(cend(), il.begin(), il.end()) + STABLE_VECTOR_CHECK_INVARIANT; + cod.release(); } #endif @@ -782,8 +782,6 @@ class stable_vector stable_vector& operator=(std::initializer_list il) { STABLE_VECTOR_CHECK_INVARIANT; - clear(); - shrink_to_fit(); assign(il.begin(), il.end()); return *this; } @@ -836,8 +834,8 @@ class stable_vector //! void assign(std::initializer_list il) { - STABLE_VECTOR_CHECK_INVARIANT; - assign(il.begin(), il.end()); + STABLE_VECTOR_CHECK_INVARIANT; + assign(il.begin(), il.end()); } #endif @@ -1404,7 +1402,7 @@ class stable_vector //! Complexity: Linear to std::distance [il.begin(), il.end()). iterator insert(const_iterator p, std::initializer_list il) { - STABLE_VECTOR_CHECK_INVARIANT; + STABLE_VECTOR_CHECK_INVARIANT; return insert(p, il.begin(), il.end()); } #endif diff --git a/test/stable_vector_test.cpp b/test/stable_vector_test.cpp index f8c9a7e..cbc3efb 100644 --- a/test/stable_vector_test.cpp +++ b/test/stable_vector_test.cpp @@ -216,6 +216,9 @@ int main() if(!boost::container::test::test_propagate_allocator()) return 1; + //////////////////////////////////// + // Initializer lists testing + //////////////////////////////////// if(!test_methods_with_initializer_list_as_argument()) { std::cerr << "test_methods_with_initializer_list_as_argument failed" << std::endl;