From 8c1bfe28812f75eb1c0d9213056fb70c1b8c07ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 28 May 2014 15:50:13 +0200 Subject: [PATCH] Removed trailing whitespaces --- bench/bench_adaptive_node_pool.cpp | 4 +- bench/bench_alloc_expand_bwd.cpp | 4 +- bench/bench_alloc_expand_fwd.cpp | 4 +- bench/bench_alloc_shrink_to_fit.cpp | 2 +- ...h_alloc_stable_vector_burst_allocation.cpp | 4 +- bench/detail/varray.hpp | 42 +++++------ bench/detail/varray_concept.hpp | 4 +- bench/detail/varray_util.hpp | 10 +-- bench/varray.hpp | 6 +- build/Jamfile.v2 | 2 +- doc/Jamfile.v2 | 10 +-- doc/container.qbk | 40 +++++------ example/doc_custom_tree.cpp | 2 +- include/boost/container/adaptive_pool.hpp | 16 ++--- include/boost/container/allocator.hpp | 20 +++--- include/boost/container/allocator_traits.hpp | 6 +- include/boost/container/deque.hpp | 22 +++--- .../container/detail/adaptive_node_pool.hpp | 12 ++-- .../detail/adaptive_node_pool_impl.hpp | 2 +- include/boost/container/detail/alloc_lib.h | 2 +- .../container/detail/allocation_type.hpp | 2 +- include/boost/container/detail/auto_link.hpp | 6 +- include/boost/container/detail/destroyers.hpp | 2 +- include/boost/container/detail/flat_tree.hpp | 16 ++--- include/boost/container/detail/iterators.hpp | 20 +++--- .../boost/container/detail/math_functions.hpp | 2 +- .../container/detail/node_alloc_holder.hpp | 2 +- include/boost/container/detail/node_pool.hpp | 8 +-- .../boost/container/detail/node_pool_impl.hpp | 12 ++-- include/boost/container/detail/tree.hpp | 6 +- include/boost/container/detail/utilities.hpp | 4 +- include/boost/container/flat_map.hpp | 6 +- include/boost/container/list.hpp | 6 +- include/boost/container/node_allocator.hpp | 16 ++--- include/boost/container/scoped_allocator.hpp | 28 ++++---- include/boost/container/slist.hpp | 4 +- include/boost/container/stable_vector.hpp | 6 +- include/boost/container/static_vector.hpp | 6 +- include/boost/container/string.hpp | 70 +++++++++---------- include/boost/container/vector.hpp | 20 +++--- index.html | 2 +- src/dlmalloc_ext_2_8_6.c | 20 +++--- test/alloc_basic_test.cpp | 2 +- test/alloc_full_test.cpp | 20 +++--- test/check_equal_containers.hpp | 4 +- test/deque_test.cpp | 6 +- test/expand_bwd_test_allocator.hpp | 4 +- test/list_test.hpp | 2 +- test/map_test.cpp | 2 +- test/map_test.hpp | 6 +- test/movable_int.hpp | 4 +- test/print_container.hpp | 2 +- test/scoped_allocator_adaptor_test.cpp | 2 +- test/scoped_allocator_usage_test.cpp | 2 +- test/set_test.cpp | 2 +- test/set_test.hpp | 4 +- test/string_test.cpp | 10 +-- test/vector_test.hpp | 6 +- 58 files changed, 278 insertions(+), 278 deletions(-) diff --git a/bench/bench_adaptive_node_pool.cpp b/bench/bench_adaptive_node_pool.cpp index 5c0eb93..2085c07 100644 --- a/bench/bench_adaptive_node_pool.cpp +++ b/bench/bench_adaptive_node_pool.cpp @@ -144,7 +144,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo } timer.stop(); tinsert = timer.elapsed().wall; - + insert_inuse = boost_cont_in_use_memory(); insert_stats = boost_cont_malloc_stats(); /* @@ -248,7 +248,7 @@ void list_test_template(std::size_t num_iterations, std::size_t num_elements, bo void print_header() { - std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" + std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" << "Insertion time(ns)" << ";" << "System bytes" << ";" << "System overhead(%)" << ";" diff --git a/bench/bench_alloc_expand_bwd.cpp b/bench/bench_alloc_expand_bwd.cpp index c2ba54e..3094968 100644 --- a/bench/bench_alloc_expand_bwd.cpp +++ b/bench/bench_alloc_expand_bwd.cpp @@ -86,8 +86,8 @@ struct has_trivial_destructor_after_move void print_header() { - std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" - << "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";" + std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" + << "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";" << "New allocations" << ";" << "Bwd expansions" << std::endl; } diff --git a/bench/bench_alloc_expand_fwd.cpp b/bench/bench_alloc_expand_fwd.cpp index f0bf179..1f88da4 100644 --- a/bench/bench_alloc_expand_fwd.cpp +++ b/bench/bench_alloc_expand_fwd.cpp @@ -228,8 +228,8 @@ void vector_test_template(unsigned int num_iterations, unsigned int num_elements void print_header() { - std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" - << "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";" + std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" + << "Capacity" << ";" << "push_back(ns)" << ";" << "Allocator calls" << ";" << "New allocations" << ";" << "Fwd expansions" << std::endl; } diff --git a/bench/bench_alloc_shrink_to_fit.cpp b/bench/bench_alloc_shrink_to_fit.cpp index 33bde3e..7a9ae62 100644 --- a/bench/bench_alloc_shrink_to_fit.cpp +++ b/bench/bench_alloc_shrink_to_fit.cpp @@ -65,7 +65,7 @@ class MyInt void print_header() { - std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" + std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" << "num_shrink" << ";" << "shrink_to_fit(ns)" << std::endl; } diff --git a/bench/bench_alloc_stable_vector_burst_allocation.cpp b/bench/bench_alloc_stable_vector_burst_allocation.cpp index 03feb2b..cbbde70 100644 --- a/bench/bench_alloc_stable_vector_burst_allocation.cpp +++ b/bench/bench_alloc_stable_vector_burst_allocation.cpp @@ -148,7 +148,7 @@ void stable_vector_test_template(unsigned int num_iterations, unsigned int num_e timer.start(); for(unsigned int r = 0; r != num_iterations; ++r){ - std::size_t init_pos = (num_iterations-1)-r; + std::size_t init_pos = (num_iterations-1)-r; l.erase(ranges_to_erase[init_pos], l.end()); } timer.stop(); @@ -180,7 +180,7 @@ void stable_vector_test_template(unsigned int num_iterations, unsigned int num_e void print_header() { - std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" + std::cout << "Allocator" << ";" << "Iterations" << ";" << "Size" << ";" << "Insertion time(ns)" << ";" << "Erasure time(ns)" << ";" << std::endl; } diff --git a/bench/detail/varray.hpp b/bench/detail/varray.hpp index 861e27b..30f791e 100644 --- a/bench/detail/varray.hpp +++ b/bench/detail/varray.hpp @@ -53,13 +53,13 @@ template class varray; namespace strategy { - + // TODO: Improve error messages // possibly include N in the strategy, and provide size as an optoinal allocate_failed parameter? // Example of current error with reserve(4) when capacity is 3: // "boost/container/varray.hpp(66): size can't exceed the capacity" // Could say -// "cannot reserve(4) due to fixed capacity of 3 elements" +// "cannot reserve(4) due to fixed capacity of 3 elements" //! @brief The default strategy. //! @@ -189,12 +189,12 @@ struct varray_traits * change in size, along with the static allocation, low overhead, and fixed capacity of boost::array. * * A varray is a sequence that supports random access to elements, constant time insertion and - * removal of elements at the end, and linear time insertion and removal of elements at the beginning or + * removal of elements at the end, and linear time insertion and removal of elements at the beginning or * in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity - * because elements are stored within the object itself similarly to an array. However, objects are + * because elements are stored within the object itself similarly to an array. However, objects are * initialized as they are inserted into varray unlike C arrays or std::array which must construct * all elements on instantiation. The behavior of varray enables the use of statically allocated - * elements in cases with complex object lifetime requirements that would otherwise not be trivially + * elements in cases with complex object lifetime requirements that would otherwise not be trivially * possible. * * @par Error Handling @@ -219,7 +219,7 @@ class varray typedef container_detail::varray_traits< Value, Capacity, Strategy > vt; - + typedef typename vt::error_handler errh; BOOST_MPL_ASSERT_MSG( @@ -354,7 +354,7 @@ public: : m_size(0) { //BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal)); // Make sure you passed a ForwardIterator - + this->assign(first, last); // may throw } @@ -393,7 +393,7 @@ public: : m_size(other.size()) { errh::check_capacity(*this, other.size()); // may throw - + namespace sv = varray_detail; sv::uninitialized_copy(other.begin(), other.end(), this->begin()); // may throw } @@ -610,7 +610,7 @@ public: typedef typename vt::use_optimized_swap use_optimized_swap; - this->swap_dispatch(other, use_optimized_swap()); + this->swap_dispatch(other, use_optimized_swap()); } //! @pre count <= capacity() @@ -672,7 +672,7 @@ public: else { errh::check_capacity(*this, count); // may throw - + std::uninitialized_fill(this->end(), this->begin() + count, value); // may throw } m_size = count; // update end @@ -716,7 +716,7 @@ public: typedef typename vt::disable_trivial_init dti; errh::check_capacity(*this, m_size + 1); // may throw - + namespace sv = varray_detail; sv::construct(dti(), this->end(), value); // may throw ++m_size; // update end @@ -844,7 +844,7 @@ public: namespace sv = varray_detail; difference_type to_move = std::distance(position, this->end()); - + // TODO - should following lines check for exception and revert to the old size? if ( count < static_cast(to_move) ) @@ -945,9 +945,9 @@ public: errh::check_iterator_end_eq(*this, first); errh::check_iterator_end_eq(*this, last); - + difference_type n = std::distance(first, last); - + //TODO - add invalid range check? //BOOST_ASSERT_MSG(0 <= n, "invalid range"); //TODO - add this->size() check? @@ -1346,7 +1346,7 @@ public: return boost::addressof(*(this->ptr())); } - + //! @brief Returns iterator to the first element. //! //! @return iterator to the first element contained in the vector. @@ -1606,7 +1606,7 @@ private: typename varray::aligned_storage_type >::type storage_type; - + storage_type temp; Value * temp_ptr = reinterpret_cast(temp.address()); @@ -1729,9 +1729,9 @@ private: void insert_dispatch(iterator position, Iterator first, Iterator last, boost::random_access_traversal_tag const&) { //BOOST_CONCEPT_ASSERT((boost_concepts::RandomAccessTraversal)); // Make sure you passed a RandomAccessIterator - + errh::check_iterator_end_eq(*this, position); - + typename boost::iterator_difference::type count = std::distance(first, last); @@ -1766,7 +1766,7 @@ private: std::ptrdiff_t d = std::distance(position, this->begin() + Capacity); std::size_t count = sv::uninitialized_copy_s(first, last, position, d); // may throw - + errh::check_capacity(*this, count <= static_cast(d) ? m_size + count : Capacity + 1); // may throw m_size += count; @@ -1775,7 +1775,7 @@ private: { typename boost::iterator_difference::type count = std::distance(first, last); - + errh::check_capacity(*this, m_size + count); // may throw this->insert_in_the_middle(position, first, last, count); // may throw @@ -1977,7 +1977,7 @@ public: errh::check_capacity(*this, count); // may throw } - + // nothrow void reserve(size_type count) { diff --git a/bench/detail/varray_concept.hpp b/bench/detail/varray_concept.hpp index ba31aae..103c60b 100644 --- a/bench/detail/varray_concept.hpp +++ b/bench/detail/varray_concept.hpp @@ -13,7 +13,7 @@ #include namespace boost { namespace container { namespace container_detail { namespace concept { - + /** * VArrayStrategyConcept * @@ -41,7 +41,7 @@ struct VArrayStrategy { // must implement allocate_failed str->allocate_failed(); - + boost::ignore_unused_variable_warning(str); } }; diff --git a/bench/detail/varray_util.hpp b/bench/detail/varray_util.hpp index 01b533b..161e5ee 100644 --- a/bench/detail/varray_util.hpp +++ b/bench/detail/varray_util.hpp @@ -52,9 +52,9 @@ namespace boost { namespace container { namespace varray_detail { template struct are_elements_contiguous : boost::is_pointer {}; - + #if defined(BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION) && !defined(BOOST_NO_EXCEPTIONS) - + template struct are_elements_contiguous< boost::container::container_detail::vector_const_iterator @@ -68,7 +68,7 @@ struct are_elements_contiguous< {}; #if defined(BOOST_DINKUMWARE_STDLIB) - + template struct are_elements_contiguous< std::_Vector_const_iterator @@ -101,7 +101,7 @@ struct are_elements_contiguous< #else // OTHER_STDLIB // TODO - add other iterators implementations - + #endif // STDLIB #endif // BOOST_CONTAINER_VARRAY_ENABLE_VECTORS_OPTIMIZATION && !BOOST_NO_EXCEPTIONS @@ -212,7 +212,7 @@ inline O copy(I first, I last, O dst) > >::type use_memmove; - + return copy_dispatch(first, last, dst, use_memmove()); // may throw } diff --git a/bench/varray.hpp b/bench/varray.hpp index 4e72039..c12b1a5 100644 --- a/bench/varray.hpp +++ b/bench/varray.hpp @@ -32,12 +32,12 @@ namespace boost { namespace container { * change in size, along with the static allocation, low overhead, and fixed capacity of boost::array. * * A varray is a sequence that supports random access to elements, constant time insertion and - * removal of elements at the end, and linear time insertion and removal of elements at the beginning or + * removal of elements at the end, and linear time insertion and removal of elements at the beginning or * in the middle. The number of elements in a varray may vary dynamically up to a fixed capacity - * because elements are stored within the object itself similarly to an array. However, objects are + * because elements are stored within the object itself similarly to an array. However, objects are * initialized as they are inserted into varray unlike C arrays or std::array which must construct * all elements on instantiation. The behavior of varray enables the use of statically allocated - * elements in cases with complex object lifetime requirements that would otherwise not be trivially + * elements in cases with complex object lifetime requirements that would otherwise not be trivially * possible. * * @par Error Handling diff --git a/build/Jamfile.v2 b/build/Jamfile.v2 index a371c4a..6d3e9fd 100644 --- a/build/Jamfile.v2 +++ b/build/Jamfile.v2 @@ -1,4 +1,4 @@ -# (C) Copyright Vladimir Prus, David Abrahams, Michael Stevens, Hartmut Kaiser, +# (C) Copyright Vladimir Prus, David Abrahams, Michael Stevens, Hartmut Kaiser, # Ion Gaztanaga 2007-2008 # Use, modification and distribution are subject to the # Boost Software License, Version 1.0. (See accompanying file diff --git a/doc/Jamfile.v2 b/doc/Jamfile.v2 index 90d6feb..2c0b382 100644 --- a/doc/Jamfile.v2 +++ b/doc/Jamfile.v2 @@ -61,22 +61,22 @@ boostbook standalone pdf:boost.url.prefix=http://www.boost.org/doc/libs/release/doc/html # Build requirements go here: - + # on (or off) one turns on (or off) indexing: on - + # Turns on (or off) auto-index-verbose for diagnostic info. # This is highly recommended until you have got all the many details correct! on - + # Choose the indexing method (separately for html and PDF) - see manual. # Choose indexing method for PDFs: pdf:off - + # Choose indexing method for html: html:on docbook:on - + # Set the name of the script file to use (index.idx is popular): $(here)/index.idx # Commands in the script file should all use RELATIVE PATHS diff --git a/doc/container.qbk b/doc/container.qbk index fccbc8d..880d101 100644 --- a/doc/container.qbk +++ b/doc/container.qbk @@ -278,7 +278,7 @@ a throw-callback declared in [headerref boost/container/throw_exception.hpp]: * If `BOOST_CONTAINER_USER_DEFINED_THROW_CALLBACKS` is defined, then the programmer must provide its own definition for all `throw_xxx` functions. Those functions can't return, they must throw an exception or call `std::exit` or `std::abort`. * Else if `BOOST_NO_EXCEPTIONS` is defined, a `BOOST_ASSERT_MSG` assertion is triggered - (see [@http://www.boost.org/libs/utility/assert.html Boost.Assert] for more information). + (see [@http://www.boost.org/libs/utility/assert.html Boost.Assert] for more information). If this assertion returns, then `std::abort` is called. * Else, an appropriate standard library exception is thrown (like `std::out_of_range`). @@ -487,27 +487,27 @@ complementary. [section:static_vector ['static_vector]] -`static_vector` is an hybrid between `vector` and `array`: like `vector`, it's a sequence container +`static_vector` is an hybrid between `vector` and `array`: like `vector`, it's a sequence container with contiguous storage that can change in size, along with the static allocation, low overhead, and fixed capacity of `array`. `static_vector` is based on Adam Wulkiewicz and Andrew Hundt's high-performance [@https://svn.boost.org/svn/boost/sandbox/varray/doc/html/index.html varray] class. -The number of elements in a `static_vector` may vary dynamically up to a fixed capacity -because elements are stored within the object itself similarly to an array. However, objects are -initialized as they are inserted into `static_vector` unlike C arrays or `std::array` which must construct -all elements on instantiation. The behavior of `static_vector` enables the use of statically allocated -elements in cases with complex object lifetime requirements that would otherwise not be trivially +The number of elements in a `static_vector` may vary dynamically up to a fixed capacity +because elements are stored within the object itself similarly to an array. However, objects are +initialized as they are inserted into `static_vector` unlike C arrays or `std::array` which must construct +all elements on instantiation. The behavior of `static_vector` enables the use of statically allocated +elements in cases with complex object lifetime requirements that would otherwise not be trivially possible. Some other properties: * Random access to elements * Constant time insertion and removal of elements at the end * Linear time insertion and removal of elements at the beginning or in the middle. - -`static_vector` is well suited for use in a buffer, the internal implementation of other + +`static_vector` is well suited for use in a buffer, the internal implementation of other classes, or use cases where there is a fixed limit to the number of elements that must be stored. -Embedded and realtime applications where allocation either may not be available or acceptable -are a particular case where `static_vector` can be beneficial. +Embedded and realtime applications where allocation either may not be available or acceptable +are a particular case where `static_vector` can be beneficial. [endsect] @@ -535,13 +535,13 @@ using [@http://en.cppreference.com/w/cpp/language/default_initialization default [section:ordered_range_insertion Ordered range insertion for associative containers (['ordered_unique_range], ['ordered_range]) ] -When filling associative containers big performance gains can be achieved if the input range to be inserted +When filling associative containers big performance gains can be achieved if the input range to be inserted is guaranteed by the user to be ordered according to the predicate. This can happen when inserting values from a `set` to a `multiset` or between different associative container families (`[multi]set/map` vs. `flat_[multi]set/map`). [*Boost.Container] has some overloads for constructors and insertions taking an `ordered_unique_range_t` or an `ordered_range_t` tag parameters as the first argument. When an `ordered_unique_range_t` overload is used, the -user notifies the container that the input range is ordered according to the container predicate and has no +user notifies the container that the input range is ordered according to the container predicate and has no duplicates. When an `ordered_range_t` overload is used, the user notifies the container that the input range is ordered according to the container predicate but it might have duplicates. With this information, the container can avoid multiple predicate calls and improve insertion @@ -592,7 +592,7 @@ used to customize these containers: [section:constant_time_range_splice Constant-time range splice for `(s)list`] In the first C++ standard `list::size()` was not required to be constant-time, -and that caused some controversy in the C++ community. Quoting Howard Hinnant's +and that caused some controversy in the C++ community. Quoting Howard Hinnant's [@http://home.roadrunner.com/~hinnant/On_list_size.html ['On List Size]] paper: [: ['There is a considerable debate on whether `std::list::size()` should be O(1) or O(N). @@ -603,7 +603,7 @@ The usual argument notes that it is a tradeoff with:] ['If size() is O(1) and this != &x, then this method must perform a linear operation so that it can adjust the size member in each list]] -C++11 definitely required `size()` to be O(1), so range splice became O(N). However, +C++11 definitely required `size()` to be O(1), so range splice became O(N). However, Howard Hinnant's paper proposed a new `splice` overload so that even O(1) `list:size()` implementations could achieve O(1) range splice when the range size was known to the caller: @@ -629,7 +629,7 @@ then the operation is constant time, even with an O(1) size. [section:extended_allocators Extended allocators] -Many C++ programmers have ever wondered where does good old realloc fit in C++. And that's a good question. +Many C++ programmers have ever wondered where does good old realloc fit in C++. And that's a good question. Could we improve [classref boost::container::vector vector] performance using memory expansion mechanisms to avoid too many copies? But [classref boost::container::vector vector] is not the only container that could benefit from an improved allocator interface: we could take advantage of the insertion of multiple @@ -637,7 +637,7 @@ elements in [classref boost::container::list list] using a burst allocation mech costs (mutex locks, free memory searches...) that can't be amortized when using single node allocation strategies. -These improvements require extending the STL allocator interface and use make use of a new +These improvements require extending the STL allocator interface and use make use of a new general purpose allocator since new and delete don't offer expansion and burst capabilities. * [*Boost.Container] containers support an extended allocator interface based on an evolution of proposals @@ -803,7 +803,7 @@ versions. [classref ::boost::container::vector vector] does not support the strong exception guarantees given by `std::vector` in functions like `insert`, `push_back`, `emplace`, `emplace_back`, -`resize`, `reserve` or `shrink_to_fit` for either copyable or no-throw moveable classes. +`resize`, `reserve` or `shrink_to_fit` for either copyable or no-throw moveable classes. [@http://en.cppreference.com/w/cpp/utility/move_if_noexcept move_if_noexcept] is used to maintain C++03 exception safety guarantees combined with C++11 move semantics. This strong exception guarantee degrades the insertion performance of copyable and throw moveable types, @@ -902,7 +902,7 @@ use [*Boost.Container]? There are several reasons for that: * Small string optimization for [classref boost::container::basic_string basic_string]. * [link container.extended_functionality Extended functionality] beyond the standard based on user feedback to improve code performance. -* You need a portable implementation that works when compiling without exceptions support or +* You need a portable implementation that works when compiling without exceptions support or you need to customize the error handling when a container needs to signal an exceptional error. [endsect] @@ -1051,7 +1051,7 @@ use [*Boost.Container]? There are several reasons for that: [@https://svn.boost.org/trac/boost/ticket/6536 #6536], [@https://svn.boost.org/trac/boost/ticket/6566 #6566], [@https://svn.boost.org/trac/boost/ticket/6575 #6575], - + [endsect] diff --git a/example/doc_custom_tree.cpp b/example/doc_custom_tree.cpp index 651dd22..f14d2d4 100644 --- a/example/doc_custom_tree.cpp +++ b/example/doc_custom_tree.cpp @@ -53,7 +53,7 @@ int main () avl_set_no_szopt.insert(1); avl_set_no_szopt.insert(1); assert(avl_set_no_szopt.count(1) == 1); - + SplayMultiset splay_mset; splay_mset.insert(2); splay_mset.insert(2); diff --git a/include/boost/container/adaptive_pool.hpp b/include/boost/container/adaptive_pool.hpp index a1209f9..e70773a 100644 --- a/include/boost/container/adaptive_pool.hpp +++ b/include/boost/container/adaptive_pool.hpp @@ -111,11 +111,11 @@ class adaptive_pool multiallocation_chain; #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED - //!Obtains adaptive_pool from + //!Obtains adaptive_pool from //!adaptive_pool template struct rebind - { + { typedef adaptive_pool < T2 , NodesPerBlock @@ -166,7 +166,7 @@ class adaptive_pool size_type max_size() const BOOST_CONTAINER_NOEXCEPT { return size_type(-1)/sizeof(T); } - //!Allocate memory for an array of count elements. + //!Allocate memory for an array of count elements. //!Throws std::bad_alloc if there is no enough memory pointer allocate(size_type count, const void * = 0) { @@ -202,7 +202,7 @@ class adaptive_pool std::pair allocation_command(allocation_type command, - size_type limit_size, + size_type limit_size, size_type preferred_size, size_type &received_size, pointer reuse = pointer()) { @@ -264,7 +264,7 @@ class adaptive_pool singleton_t::instance().deallocate_nodes(chain); } - //!Allocates many elements of size elem_size. + //!Allocates many elements of size elem_size. //!Elements must be individually deallocated with deallocate() void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) { @@ -276,14 +276,14 @@ class adaptive_pool } chain.incorporate_after(chain.before_begin() ,(T*)BOOST_CONTAINER_MEMCHAIN_FIRSTMEM(&ch) - ,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch) + ,(T*)BOOST_CONTAINER_MEMCHAIN_LASTMEM(&ch) ,BOOST_CONTAINER_MEMCHAIN_SIZE(&ch) );*/ if(!boost_cont_multialloc_nodes(n_elements, elem_size*sizeof(T), DL_MULTIALLOC_DEFAULT_CONTIGUOUS, reinterpret_cast(&chain))){ boost::container::throw_bad_alloc(); } } - //!Allocates n_elements elements, each one of size elem_sizes[i] + //!Allocates n_elements elements, each one of size elem_sizes[i] //!Elements must be individually deallocated with deallocate() void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) { @@ -337,7 +337,7 @@ class adaptive_pool { return false; } private: - std::pair priv_allocation_command + std::pair priv_allocation_command (allocation_type command, std::size_t limit_size ,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr) { diff --git a/include/boost/container/allocator.hpp b/include/boost/container/allocator.hpp index 2b36b5e..b823a2e 100644 --- a/include/boost/container/allocator.hpp +++ b/include/boost/container/allocator.hpp @@ -57,7 +57,7 @@ class allocator //!objects of type T2 template struct rebind - { + { typedef allocator< T2 #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED , Version, AllocationDisableMask @@ -78,7 +78,7 @@ class allocator //!Constructor from related allocator. //!Never throws template - allocator(const allocator &) + allocator(const allocator &) {} }; @@ -99,7 +99,7 @@ template //! of allocation types the user wants to disable. template #endif //#ifdef BOOST_CONTAINER_DOXYGEN_INVOKED -class allocator +class allocator { typedef unsigned int allocation_type; #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED @@ -115,7 +115,7 @@ class allocator //Not assignable from other allocator allocator& operator=(const allocator&); - static const unsigned int ForbiddenMask = + static const unsigned int ForbiddenMask = BOOST_CONTAINER_ALLOCATE_NEW | BOOST_CONTAINER_EXPAND_BWD | BOOST_CONTAINER_EXPAND_FWD ; //The mask can't disable all the allocation types @@ -151,7 +151,7 @@ class allocator //!objects of type T2 template struct rebind - { + { typedef allocator other; }; @@ -175,7 +175,7 @@ class allocator > &) BOOST_CONTAINER_NOEXCEPT {} - //!Allocates memory for an array of count elements. + //!Allocates memory for an array of count elements. //!Throws std::bad_alloc if there is no enough memory //!If Version is 2, this allocated memory can only be deallocated //!with deallocate() or (for Version == 2) deallocate_many() @@ -221,7 +221,7 @@ class allocator //!This function is available only with Version == 2 std::pair allocation_command(allocation_type command, - size_type limit_size, + size_type limit_size, size_type preferred_size, size_type &received_size, pointer reuse = pointer()) { @@ -283,7 +283,7 @@ class allocator return this->deallocate_many(chain); } - //!Allocates many elements of size elem_size. + //!Allocates many elements of size elem_size. //!Elements must be individually deallocated with deallocate() //!This function is available only with Version == 2 void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) @@ -303,7 +303,7 @@ class allocator } } - //!Allocates n_elements elements, each one of size elem_sizes[i] + //!Allocates n_elements elements, each one of size elem_sizes[i] //!Elements must be individually deallocated with deallocate() //!This function is available only with Version == 2 void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) @@ -340,7 +340,7 @@ class allocator private: - std::pair priv_allocation_command + std::pair priv_allocation_command (allocation_type command, std::size_t limit_size ,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr) { diff --git a/include/boost/container/allocator_traits.hpp b/include/boost/container/allocator_traits.hpp index 613d116..72d08b9 100644 --- a/include/boost/container/allocator_traits.hpp +++ b/include/boost/container/allocator_traits.hpp @@ -316,8 +316,8 @@ struct allocator_traits #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) template - static void priv_construct(boost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args) - { + static void priv_construct(boost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args) + { const bool value = boost::container::container_detail:: has_member_function_callable_with_construct < Alloc, T*, Args... >::value; @@ -352,7 +352,7 @@ struct allocator_traits // #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS) #include BOOST_PP_LOCAL_ITERATE() - + private: #define BOOST_PP_LOCAL_MACRO(n) \ template \ diff --git a/include/boost/container/deque.hpp b/include/boost/container/deque.hpp index 119d422..1fd2bbe 100644 --- a/include/boost/container/deque.hpp +++ b/include/boost/container/deque.hpp @@ -93,9 +93,9 @@ namespace container_detail { // [start.cur, start.last) and [finish.first, finish.cur) are initialized // objects, and [start.first, start.cur) and [finish.cur, finish.last) // are uninitialized storage. -// [map, map + map_size) is a valid, non-empty range. +// [map, map + map_size) is a valid, non-empty range. // [start.node, finish.node] is a valid range contained within -// [map, map + map_size). +// [map, map + map_size). // Allocator pointer in the range [map, map + map_size) points to an allocated node // if and only if the pointer is in the range [start.node, finish.node]. template @@ -122,7 +122,7 @@ class deque_iterator typedef Pointer val_alloc_ptr; typedef typename boost::intrusive::pointer_traits:: - template rebind_pointer::type index_pointer; + template rebind_pointer::type index_pointer; Pointer m_cur; Pointer m_first; @@ -227,7 +227,7 @@ class deque_iterator deque_iterator& operator-=(difference_type n) BOOST_CONTAINER_NOEXCEPT { return *this += -n; } - + deque_iterator operator-(difference_type n) const BOOST_CONTAINER_NOEXCEPT { deque_iterator tmp(*this); return tmp -= n; } @@ -343,7 +343,7 @@ class deque_base private: deque_base(const deque_base&); - + protected: void swap_members(deque_base &x) BOOST_CONTAINER_NOEXCEPT @@ -364,7 +364,7 @@ class deque_base ptr_alloc_ptr nstart = this->members_.m_map + (this->members_.m_map_size - num_nodes) / 2; ptr_alloc_ptr nfinish = nstart + num_nodes; - + BOOST_TRY { this->priv_create_nodes(nstart, nfinish); } @@ -451,13 +451,13 @@ class deque_base ptr_alloc_t &ptr_alloc() BOOST_CONTAINER_NOEXCEPT { return members_; } - + const ptr_alloc_t &ptr_alloc() const BOOST_CONTAINER_NOEXCEPT { return members_; } allocator_type &alloc() BOOST_CONTAINER_NOEXCEPT { return members_; } - + const allocator_type &alloc() const BOOST_CONTAINER_NOEXCEPT { return members_; } }; @@ -1896,7 +1896,7 @@ class deque : protected deque_base this->priv_deallocate_node(this->members_.m_start.m_first); this->members_.m_start.priv_set_node(this->members_.m_start.m_node + 1); this->members_.m_start.m_cur = this->members_.m_start.m_first; - } + } iterator priv_reserve_elements_at_front(size_type n) { @@ -1916,7 +1916,7 @@ class deque : protected deque_base } BOOST_CATCH(...) { for (size_type j = 1; j < i; ++j) - this->priv_deallocate_node(*(this->members_.m_start.m_node - j)); + this->priv_deallocate_node(*(this->members_.m_start.m_node - j)); BOOST_RETHROW } BOOST_CATCH_END @@ -1941,7 +1941,7 @@ class deque : protected deque_base } BOOST_CATCH(...) { for (size_type j = 1; j < i; ++j) - this->priv_deallocate_node(*(this->members_.m_finish.m_node + j)); + this->priv_deallocate_node(*(this->members_.m_finish.m_node + j)); BOOST_RETHROW } BOOST_CATCH_END diff --git a/include/boost/container/detail/adaptive_node_pool.hpp b/include/boost/container/detail/adaptive_node_pool.hpp index 8914d4a..f776b51 100644 --- a/include/boost/container/detail/adaptive_node_pool.hpp +++ b/include/boost/container/detail/adaptive_node_pool.hpp @@ -42,12 +42,12 @@ struct select_private_adaptive_node_pool_impl private_adaptive_node_pool_impl < fake_segment_manager , unsigned(AlignOnly)*::boost::container::adaptive_pool_flag::align_only - | ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered + | ::boost::container::adaptive_pool_flag::size_ordered | ::boost::container::adaptive_pool_flag::address_ordered > type; }; //!Pooled memory allocator using an smart adaptive pool. Includes -//!a reference count but the class does not delete itself, this is +//!a reference count but the class does not delete itself, this is //!responsibility of user classes. Node size (NodeSize) and the number of //!nodes allocated per block (NodesPerBlock) are known at compile time. template< std::size_t NodeSize @@ -78,7 +78,7 @@ class private_adaptive_node_pool }; //!Pooled memory allocator using adaptive pool. Includes -//!a reference count but the class does not delete itself, this is +//!a reference count but the class does not delete itself, this is //!responsibility of user classes. Node size (NodeSize) and the number of //!nodes allocated per block (NodesPerBlock) are known at compile time template< std::size_t NodeSize @@ -86,8 +86,8 @@ template< std::size_t NodeSize , std::size_t MaxFreeBlocks , std::size_t OverheadPercent > -class shared_adaptive_node_pool - : public private_adaptive_node_pool +class shared_adaptive_node_pool + : public private_adaptive_node_pool { private: @@ -112,7 +112,7 @@ class shared_adaptive_node_pool //----------------------- return private_node_allocator_t::allocate_node(); } - + //!Deallocates an array pointed by ptr. Never throws void deallocate_node(void *ptr) { diff --git a/include/boost/container/detail/adaptive_node_pool_impl.hpp b/include/boost/container/detail/adaptive_node_pool_impl.hpp index 13f9723..a289ef5 100644 --- a/include/boost/container/detail/adaptive_node_pool_impl.hpp +++ b/include/boost/container/detail/adaptive_node_pool_impl.hpp @@ -639,7 +639,7 @@ class private_adaptive_node_pool_impl { //We iterate through the block tree to free the memory const_block_iterator it(m_block_container.begin()); - + if(it != itend){ for(++it; it != itend; ++it){ const_block_iterator prev(it); diff --git a/include/boost/container/detail/alloc_lib.h b/include/boost/container/detail/alloc_lib.h index 279dffe..4802d9d 100644 --- a/include/boost/container/detail/alloc_lib.h +++ b/include/boost/container/detail/alloc_lib.h @@ -277,7 +277,7 @@ BOOST_CONTAINER_DECL int boost_cont_malloc_check(); typedef unsigned int allocation_type; enum -{ +{ // constants for allocation commands BOOST_CONTAINER_ALLOCATE_NEW = 0X01, BOOST_CONTAINER_EXPAND_FWD = 0X02, diff --git a/include/boost/container/detail/allocation_type.hpp b/include/boost/container/detail/allocation_type.hpp index 6aa04ac..65d543a 100644 --- a/include/boost/container/detail/allocation_type.hpp +++ b/include/boost/container/detail/allocation_type.hpp @@ -23,7 +23,7 @@ namespace container { #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED enum allocation_type_v -{ +{ // constants for allocation commands allocate_new_v = 0x01, expand_fwd_v = 0x02, diff --git a/include/boost/container/detail/auto_link.hpp b/include/boost/container/detail/auto_link.hpp index dbc8b29..2e47333 100644 --- a/include/boost/container/detail/auto_link.hpp +++ b/include/boost/container/detail/auto_link.hpp @@ -12,11 +12,11 @@ #if defined(_MSC_VER) # pragma once -#endif +#endif // -// Automatically link to the correct build variant where possible. -// +// Automatically link to the correct build variant where possible. +// #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_CONTAINER_NO_LIB) && !defined(BOOST_CONTAINER_SOURCE) // // Set the name of our library, this will get undef'ed by auto_link.hpp diff --git a/include/boost/container/detail/destroyers.hpp b/include/boost/container/detail/destroyers.hpp index 329a6ef..0645895 100644 --- a/include/boost/container/detail/destroyers.hpp +++ b/include/boost/container/detail/destroyers.hpp @@ -198,7 +198,7 @@ struct scoped_destructor_n void shrink_forward(size_type inc) { m_n -= inc; m_p += inc; } - + ~scoped_destructor_n() { if(!m_p) return; diff --git a/include/boost/container/detail/flat_tree.hpp b/include/boost/container/detail/flat_tree.hpp index 1aa8dda..7ccf33c 100644 --- a/include/boost/container/detail/flat_tree.hpp +++ b/include/boost/container/detail/flat_tree.hpp @@ -51,7 +51,7 @@ class flat_tree_value_compare typedef Value first_argument_type; typedef Value second_argument_type; typedef bool return_type; - public: + public: flat_tree_value_compare() : Compare() {} @@ -68,7 +68,7 @@ class flat_tree_value_compare const Compare &get_comp() const { return *this; } - + Compare &get_comp() { return *this; } }; @@ -265,7 +265,7 @@ class flat_tree flat_tree& operator=(BOOST_RV_REF(flat_tree) mx) { m_data = boost::move(mx.m_data); return *this; } - public: + public: // accessors: Compare key_comp() const { return this->m_data.get_comp(); } @@ -728,8 +728,8 @@ class flat_tree { iterator i = this->lower_bound(k); iterator end_it = this->end(); - if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){ - i = end_it; + if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){ + i = end_it; } return i; } @@ -739,7 +739,7 @@ class flat_tree const_iterator i = this->lower_bound(k); const_iterator end_it = this->cend(); - if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){ + if (i != end_it && this->m_data.get_comp()(k, KeyOfValue()(*i))){ i = end_it; } return i; @@ -777,10 +777,10 @@ class flat_tree std::pair lower_bound_range(const key_type& k) const { return this->priv_lower_bound_range(this->cbegin(), this->cend(), k); } - size_type capacity() const + size_type capacity() const { return this->m_data.m_vect.capacity(); } - void reserve(size_type cnt) + void reserve(size_type cnt) { this->m_data.m_vect.reserve(cnt); } friend bool operator==(const flat_tree& x, const flat_tree& y) diff --git a/include/boost/container/detail/iterators.hpp b/include/boost/container/detail/iterators.hpp index be3c157..ffc7236 100644 --- a/include/boost/container/detail/iterators.hpp +++ b/include/boost/container/detail/iterators.hpp @@ -53,7 +53,7 @@ class constant_iterator constant_iterator& operator++() { increment(); return *this; } - + constant_iterator operator++(int) { constant_iterator result (*this); @@ -63,7 +63,7 @@ class constant_iterator constant_iterator& operator--() { decrement(); return *this; } - + constant_iterator operator--(int) { constant_iterator result (*this); @@ -164,7 +164,7 @@ class value_init_construct_iterator value_init_construct_iterator& operator++() { increment(); return *this; } - + value_init_construct_iterator operator++(int) { value_init_construct_iterator result (*this); @@ -174,7 +174,7 @@ class value_init_construct_iterator value_init_construct_iterator& operator--() { decrement(); return *this; } - + value_init_construct_iterator operator--(int) { value_init_construct_iterator result (*this); @@ -275,7 +275,7 @@ class default_init_construct_iterator default_init_construct_iterator& operator++() { increment(); return *this; } - + default_init_construct_iterator operator++(int) { default_init_construct_iterator result (*this); @@ -285,7 +285,7 @@ class default_init_construct_iterator default_init_construct_iterator& operator--() { decrement(); return *this; } - + default_init_construct_iterator operator--(int) { default_init_construct_iterator result (*this); @@ -386,7 +386,7 @@ class repeat_iterator this_type& operator++() { increment(); return *this; } - + this_type operator++(int) { this_type result (*this); @@ -396,7 +396,7 @@ class repeat_iterator this_type& operator--() { increment(); return *this; } - + this_type operator--(int) { this_type result (*this); @@ -497,7 +497,7 @@ class emplace_iterator this_type& operator++() { increment(); return *this; } - + this_type operator++(int) { this_type result (*this); @@ -507,7 +507,7 @@ class emplace_iterator this_type& operator--() { decrement(); return *this; } - + this_type operator--(int) { this_type result (*this); diff --git a/include/boost/container/detail/math_functions.hpp b/include/boost/container/detail/math_functions.hpp index 3eff6b1..b27cfb4 100644 --- a/include/boost/container/detail/math_functions.hpp +++ b/include/boost/container/detail/math_functions.hpp @@ -96,7 +96,7 @@ inline std::size_t floor_log2 (std::size_t x) std::size_t n = x; std::size_t log2 = 0; - + for(std::size_t shift = Bits >> 1; shift; shift >>= 1){ std::size_t tmp = n >> shift; if (tmp) diff --git a/include/boost/container/detail/node_alloc_holder.hpp b/include/boost/container/detail/node_alloc_holder.hpp index 3c1b4f6..a32811d 100644 --- a/include/boost/container/detail/node_alloc_holder.hpp +++ b/include/boost/container/detail/node_alloc_holder.hpp @@ -151,7 +151,7 @@ struct node_alloc_holder { this->icont().swap(x.icont()); } void copy_assign_alloc(const node_alloc_holder &x) - { + { container_detail::bool_ flag; container_detail::assign_alloc( static_cast(this->members_) , static_cast(x.members_), flag); diff --git a/include/boost/container/detail/node_pool.hpp b/include/boost/container/detail/node_pool.hpp index 323935e..56c3d8a 100644 --- a/include/boost/container/detail/node_pool.hpp +++ b/include/boost/container/detail/node_pool.hpp @@ -35,7 +35,7 @@ namespace container { namespace container_detail { //!Pooled memory allocator using single segregated storage. Includes -//!a reference count but the class does not delete itself, this is +//!a reference count but the class does not delete itself, this is //!responsibility of user classes. Node size (NodeSize) and the number of //!nodes allocated per block (NodesPerBlock) are known at compile time template< std::size_t NodeSize, std::size_t NodesPerBlock > @@ -64,8 +64,8 @@ class private_node_pool template< std::size_t NodeSize , std::size_t NodesPerBlock > -class shared_node_pool - : public private_node_pool +class shared_node_pool + : public private_node_pool { private: typedef private_node_pool private_node_allocator_t; @@ -90,7 +90,7 @@ class shared_node_pool //----------------------- return private_node_allocator_t::allocate_node(); } - + //!Deallocates an array pointed by ptr. Never throws void deallocate_node(void *ptr) { diff --git a/include/boost/container/detail/node_pool_impl.hpp b/include/boost/container/detail/node_pool_impl.hpp index b7f5996..d79bcbe 100644 --- a/include/boost/container/detail/node_pool_impl.hpp +++ b/include/boost/container/detail/node_pool_impl.hpp @@ -87,7 +87,7 @@ class private_node_pool_impl void *allocate_node() { return this->priv_alloc_node(); } - + //!Deallocates an array pointed by ptr. Never throws void deallocate_node(void *ptr) { this->priv_dealloc_node(ptr); } @@ -235,7 +235,7 @@ class private_node_pool_impl push_in_list(free_nodes_t &l, typename free_nodes_t::iterator &it) : slist_(l), last_it_(it) {} - + void operator()(typename free_nodes_t::pointer p) const { slist_.push_front(*p); @@ -257,7 +257,7 @@ class private_node_pool_impl is_between(const void *addr, std::size_t size) : beg_(static_cast(addr)), end_(beg_+size) {} - + bool operator()(typename free_nodes_t::const_reference v) const { return (beg_ <= reinterpret_cast(&v) && @@ -334,13 +334,13 @@ class private_node_pool_impl private: //!Returns a reference to the block hook placed in the end of the block static node_t & get_block_hook (void *block, size_type blocksize) - { - return *reinterpret_cast(reinterpret_cast(block) + blocksize); + { + return *reinterpret_cast(reinterpret_cast(block) + blocksize); } //!Returns the starting address of the block reference to the block hook placed in the end of the block void *get_block_from_hook (node_t *hook, size_type blocksize) - { + { return (reinterpret_cast(hook) - blocksize); } diff --git a/include/boost/container/detail/tree.hpp b/include/boost/container/detail/tree.hpp index 55952c8..8ccf279 100644 --- a/include/boost/container/detail/tree.hpp +++ b/include/boost/container/detail/tree.hpp @@ -385,7 +385,7 @@ class RecyclingCloner { p->do_assign(other.m_data); } static void do_assign(node_ptr_type &p, const node_type &other, bool_) - { p->do_move_assign(const_cast(other).m_data); } + { p->do_move_assign(const_cast(other).m_data); } node_ptr_type operator()(const node_type &other) const { @@ -461,7 +461,7 @@ class tree typedef typename container_detail::intrusive_tree_type < A, ValComp, Options::tree_type , Options::optimize_size>::type Icont; - typedef container_detail::node_alloc_holder + typedef container_detail::node_alloc_holder AllocHolder; typedef typename AllocHolder::NodePtr NodePtr; typedef tree < Key, Value, KeyOfValue @@ -723,7 +723,7 @@ class tree return *this; } - public: + public: // accessors: value_compare value_comp() const { return this->icont().value_comp().value_comp(); } diff --git a/include/boost/container/detail/utilities.hpp b/include/boost/container/detail/utilities.hpp index d26136e..9558963 100644 --- a/include/boost/container/detail/utilities.hpp +++ b/include/boost/container/detail/utilities.hpp @@ -1159,7 +1159,7 @@ template + > void copy_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits::size_type n_i , O out_start, typename allocator_traits::size_type n_o ) { @@ -1183,7 +1183,7 @@ template + > void move_assign_range_alloc_n( A &a, I inp_start, typename allocator_traits::size_type n_i , O out_start, typename allocator_traits::size_type n_o ) { diff --git a/include/boost/container/flat_map.hpp b/include/boost/container/flat_map.hpp index bbe7396..7f64e32 100644 --- a/include/boost/container/flat_map.hpp +++ b/include/boost/container/flat_map.hpp @@ -457,7 +457,7 @@ class flat_map //! Throws: Nothing. //! //! Complexity: Constant. - size_type capacity() const BOOST_CONTAINER_NOEXCEPT + size_type capacity() const BOOST_CONTAINER_NOEXCEPT { return m_flat_tree.capacity(); } //! Effects: If n is less than or equal to capacity(), this call has no @@ -469,7 +469,7 @@ class flat_map //! //! Note: If capacity() is less than "cnt", iterators and references to //! to values might be invalidated. - void reserve(size_type cnt) + void reserve(size_type cnt) { m_flat_tree.reserve(cnt); } //! Effects: Tries to deallocate the excess of memory created @@ -1362,7 +1362,7 @@ class flat_multimap //! //! Note: If capacity() is less than "cnt", iterators and references to //! to values might be invalidated. - void reserve(size_type cnt) + void reserve(size_type cnt) { m_flat_tree.reserve(cnt); } //! Effects: Tries to deallocate the excess of memory created diff --git a/include/boost/container/list.hpp b/include/boost/container/list.hpp index 34ef678..291c190 100644 --- a/include/boost/container/list.hpp +++ b/include/boost/container/list.hpp @@ -1193,7 +1193,7 @@ class list //! Throws: If comparison throws. //! //! Notes: Iterators and references are not invalidated. - //! + //! //! Complexity: The number of comparisons is approximately N log N, where N //! is the list's size. void sort() @@ -1326,13 +1326,13 @@ class list return iterator(this->icont().insert(p.get(), *tmp)); } - void priv_push_back (const T &x) + void priv_push_back (const T &x) { this->insert(this->cend(), x); } void priv_push_back (BOOST_RV_REF(T) x) { this->insert(this->cend(), boost::move(x)); } - void priv_push_front (const T &x) + void priv_push_front (const T &x) { this->insert(this->cbegin(), x); } void priv_push_front (BOOST_RV_REF(T) x) diff --git a/include/boost/container/node_allocator.hpp b/include/boost/container/node_allocator.hpp index 35ed382..b9c4f89 100644 --- a/include/boost/container/node_allocator.hpp +++ b/include/boost/container/node_allocator.hpp @@ -91,12 +91,12 @@ class node_allocator transform_multiallocation_chain multiallocation_chain; #endif //#ifndef BOOST_CONTAINER_DOXYGEN_INVOKED - - //!Obtains node_allocator from + + //!Obtains node_allocator from //!node_allocator template struct rebind - { + { typedef node_allocator< T2, NodesPerBlock #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED , Version @@ -144,7 +144,7 @@ class node_allocator size_type max_size() const { return size_type(-1)/sizeof(T); } - //!Allocate memory for an array of count elements. + //!Allocate memory for an array of count elements. //!Throws std::bad_alloc if there is no enough memory pointer allocate(size_type count, const void * = 0) { @@ -192,7 +192,7 @@ class node_allocator std::pair allocation_command(allocation_type command, - size_type limit_size, + size_type limit_size, size_type preferred_size, size_type &received_size, pointer reuse = pointer()) { @@ -259,7 +259,7 @@ class node_allocator singleton_t::instance().deallocate_nodes(ch); } - //!Allocates many elements of size elem_size. + //!Allocates many elements of size elem_size. //!Elements must be individually deallocated with deallocate() void allocate_many(size_type elem_size, std::size_t n_elements, multiallocation_chain &chain) { @@ -275,7 +275,7 @@ class node_allocator , BOOST_CONTAINER_MEMCHAIN_SIZE(&ch)); } - //!Allocates n_elements elements, each one of size elem_sizes[i] + //!Allocates n_elements elements, each one of size elem_sizes[i] //!Elements must be individually deallocated with deallocate() void allocate_many(const size_type *elem_sizes, size_type n_elements, multiallocation_chain &chain) { @@ -318,7 +318,7 @@ class node_allocator { return false; } private: - std::pair priv_allocation_command + std::pair priv_allocation_command (allocation_type command, std::size_t limit_size ,std::size_t preferred_size,std::size_t &received_size, void *reuse_ptr) { diff --git a/include/boost/container/scoped_allocator.hpp b/include/boost/container/scoped_allocator.hpp index fac90f5..e594c0a 100644 --- a/include/boost/container/scoped_allocator.hpp +++ b/include/boost/container/scoped_allocator.hpp @@ -47,7 +47,7 @@ namespace boost { namespace container { //! ill-formed. //! //! -//! template > +//! template > //! class Z { //! public: //! typedef Allocator allocator_type; @@ -62,7 +62,7 @@ namespace boost { namespace container { //! //! // Specialize trait for class template Z //! template > -//! struct constructible_with_allocator_suffix > +//! struct constructible_with_allocator_suffix > //! : ::boost::true_type { }; //! //! @@ -80,7 +80,7 @@ struct constructible_with_allocator_suffix {}; //! Remark: if a specialization is derived from true_type, indicates that T may be constructed -//! with allocator_arg and T::allocator_type as its first two constructor arguments. +//! with allocator_arg and T::allocator_type as its first two constructor arguments. //! Ideally, all constructors of T (including the copy and move constructors) should have a variant //! that accepts these two initial arguments. //! @@ -95,26 +95,26 @@ struct constructible_with_allocator_suffix //! class Y { //! public: //! typedef Allocator allocator_type; -//! +//! //! // Default constructor with and allocator-extended default constructor //! Y(); //! Y(allocator_arg_t, const allocator_type& a); -//! +//! //! // Copy constructor and allocator-extended copy constructor //! Y(const Y& yy); //! Y(allocator_arg_t, const allocator_type& a, const Y& yy); -//! +//! //! // Variadic constructor and allocator-extended variadic constructor //! template Y(Args&& args...); -//! template +//! template //! Y(allocator_arg_t, const allocator_type& a, Args&&... args); //! }; -//! +//! //! // Specialize trait for class template Y //! template > -//! struct constructible_with_allocator_prefix > +//! struct constructible_with_allocator_prefix > //! : ::boost::true_type { }; -//! +//! //! //! //! Note: This trait is a workaround inspired by "N2554: The Scoped Allocator Model (Rev 2)" @@ -960,7 +960,7 @@ class scoped_allocator_adaptor_base scoped_allocator_adaptor_base(internal_type_t, BOOST_FWD_REF(OuterA2) outerAlloc, const inner_allocator_type &) : outer_allocator_type(::boost::forward(outerAlloc)) {} - + public: scoped_allocator_adaptor_base &operator=(BOOST_COPY_ASSIGN_REF(scoped_allocator_adaptor_base) other) { @@ -1375,7 +1375,7 @@ class scoped_allocator_adaptor template void construct(container_detail::pair* p, BOOST_FWD_REF(U) x, BOOST_FWD_REF(V) y) { this->construct_pair(p, ::boost::forward(x), ::boost::forward(y)); } - + template void construct(std::pair* p, const std::pair& x) { this->construct_pair(p, x); } @@ -1384,7 +1384,7 @@ class scoped_allocator_adaptor void construct( container_detail::pair* p , const container_detail::pair& x) { this->construct_pair(p, x); } - + template void construct( std::pair* p , BOOST_RV_REF_BEG std::pair BOOST_RV_REF_END x) @@ -1489,7 +1489,7 @@ inline bool operator==( #endif >& b) { - #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) + #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED) const bool has_zero_inner = sizeof...(InnerAllocs) == 0u; #else const bool has_zero_inner = diff --git a/include/boost/container/slist.hpp b/include/boost/container/slist.hpp index 1ec8ee4..6941d29 100644 --- a/include/boost/container/slist.hpp +++ b/include/boost/container/slist.hpp @@ -1295,7 +1295,7 @@ class slist this->insert_after(prev, n, x); return ++iterator(prev.get()); } - + //! Requires: p must be a valid iterator of *this. //! //! Effects: Insert a copy of the [first, last) range before p. @@ -1493,7 +1493,7 @@ class slist #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED private: - void priv_push_front (const T &x) + void priv_push_front (const T &x) { this->insert_after(this->cbefore_begin(), x); } void priv_push_front (BOOST_RV_REF(T) x) diff --git a/include/boost/container/stable_vector.hpp b/include/boost/container/stable_vector.hpp index 691cf58..f5e9314 100644 --- a/include/boost/container/stable_vector.hpp +++ b/include/boost/container/stable_vector.hpp @@ -77,7 +77,7 @@ class clear_on_destroy { if(do_clear_){ c_.clear(); - c_.priv_clear_pool(); + c_.priv_clear_pool(); } } @@ -708,7 +708,7 @@ class stable_vector ~stable_vector() { this->clear(); - this->priv_clear_pool(); + this->priv_clear_pool(); } //! Effects: Makes *this contain the same elements as x. @@ -1068,7 +1068,7 @@ class stable_vector throw_length_error("stable_vector::reserve max_size() exceeded"); } - size_type sz = this->size(); + size_type sz = this->size(); size_type old_capacity = this->capacity(); if(n > old_capacity){ index_traits_type::initialize_end_node(this->index, this->internal_data.end_node, n); diff --git a/include/boost/container/static_vector.hpp b/include/boost/container/static_vector.hpp index 6734163..234fc26 100644 --- a/include/boost/container/static_vector.hpp +++ b/include/boost/container/static_vector.hpp @@ -73,12 +73,12 @@ class static_storage_allocator //!change in size, along with the static allocation, low overhead, and fixed capacity of boost::array. //! //!A static_vector is a sequence that supports random access to elements, constant time insertion and -//!removal of elements at the end, and linear time insertion and removal of elements at the beginning or +//!removal of elements at the end, and linear time insertion and removal of elements at the beginning or //!in the middle. The number of elements in a static_vector may vary dynamically up to a fixed capacity -//!because elements are stored within the object itself similarly to an array. However, objects are +//!because elements are stored within the object itself similarly to an array. However, objects are //!initialized as they are inserted into static_vector unlike C arrays or std::array which must construct //!all elements on instantiation. The behavior of static_vector enables the use of statically allocated -//!elements in cases with complex object lifetime requirements that would otherwise not be trivially +//!elements in cases with complex object lifetime requirements that would otherwise not be trivially //!possible. //! //!@par Error Handling diff --git a/include/boost/container/string.hpp b/include/boost/container/string.hpp index 116d8b5..89bb5ac 100644 --- a/include/boost/container/string.hpp +++ b/include/boost/container/string.hpp @@ -55,7 +55,7 @@ namespace container { #ifndef BOOST_CONTAINER_DOXYGEN_INVOKED namespace container_detail { // ------------------------------------------------------------ -// Class basic_string_base. +// Class basic_string_base. // basic_string_base is a helper class that makes it it easier to write // an exception-safe version of basic_string. The constructor allocates, @@ -88,20 +88,20 @@ class basic_string_base basic_string_base(const allocator_type& a, size_type n) : members_(a) - { + { this->init(); this->allocate_initial_block(n); } basic_string_base(BOOST_RV_REF(basic_string_base) b) : members_(boost::move(b.alloc())) - { + { this->init(); this->swap_data(b); } ~basic_string_base() - { + { if(!this->is_short()){ this->deallocate_block(); this->is_short(true); @@ -149,7 +149,7 @@ class basic_string_base //This type has the same alignment and size as long_t but it's POD //so, unlike long_t, it can be placed in a union - + typedef typename boost::aligned_storage< sizeof(long_t), container_detail::alignment_of::value>::type long_raw_t; @@ -276,7 +276,7 @@ class basic_string_base } void deallocate(pointer p, size_type n) - { + { if (p && (n > InternalBufferChars)) this->alloc().deallocate(p, n); } @@ -325,7 +325,7 @@ class basic_string_base void deallocate_block() { this->deallocate(this->priv_addr(), this->priv_storage()); } - + size_type max_size() const { return allocator_traits_type::max_size(this->alloc()) - 1; } @@ -368,13 +368,13 @@ class basic_string_base { return this->members_.m_repr.long_repr().storage; } void priv_storage(size_type storage) - { + { if(!this->is_short()) this->priv_long_storage(storage); } void priv_long_storage(size_type storage) - { + { this->members_.m_repr.long_repr().storage = storage; } @@ -388,7 +388,7 @@ class basic_string_base { return this->members_.m_repr.long_repr().length; } void priv_size(size_type sz) - { + { if(this->is_short()) this->priv_short_size(sz); else @@ -396,12 +396,12 @@ class basic_string_base } void priv_short_size(size_type sz) - { + { this->members_.m_repr.s.h.length = (unsigned char)sz; } void priv_long_size(size_type sz) - { + { this->members_.m_repr.long_repr().length = sz; } @@ -706,7 +706,7 @@ class basic_string //! Complexity: Constant. ~basic_string() BOOST_CONTAINER_NOEXCEPT {} - + //! Effects: Copy constructs a string. //! //! Postcondition: x == *this. @@ -1236,7 +1236,7 @@ class basic_string //! length n whose elements are a copy of those pointed to by s. //! //! Throws: If memory allocation throws or length_error if n > max_size(). - //! + //! //! Returns: *this basic_string& assign(const CharT* s, size_type n) { return this->assign(s, s + n); } @@ -1258,16 +1258,16 @@ class basic_string //! Effects: Equivalent to assign(basic_string(first, last)). //! //! Returns: *this - basic_string& assign(const CharT* first, const CharT* last) - { + basic_string& assign(const CharT* first, const CharT* last) + { size_type n = static_cast(last - first); - this->reserve(n); - CharT* ptr = container_detail::to_raw_pointer(this->priv_addr()); - Traits::copy(ptr, first, n); - this->priv_construct_null(ptr + n); - this->priv_size(n); - return *this; - } + this->reserve(n); + CharT* ptr = container_detail::to_raw_pointer(this->priv_addr()); + Traits::copy(ptr, first, n); + this->priv_construct_null(ptr + n); + this->priv_size(n); + return *this; + } //! Effects: Equivalent to assign(basic_string(first, last)). //! @@ -1435,7 +1435,7 @@ class basic_string for ( ; first != last; ++first, ++p) { p = this->insert(p, *first); } - return this->begin() + n_pos; + return this->begin() + n_pos; } #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED) @@ -1459,7 +1459,7 @@ class basic_string //Check if we have enough capacity if (remaining >= n){ - enough_capacity = true; + enough_capacity = true; } else { //Otherwise expand current buffer or allocate new storage @@ -1568,7 +1568,7 @@ class basic_string const pointer addr = this->priv_addr(); erase(addr + pos, addr + pos + container_detail::min_value(n, this->size() - pos)); return *this; - } + } //! Effects: Removes the character referred to by p. //! @@ -2527,7 +2527,7 @@ wstring; // Operator+ -template inline +template inline basic_string operator+(const basic_string& x ,const basic_string& y) @@ -2576,7 +2576,7 @@ template inline return y; } -template inline +template inline basic_string operator+ (basic_string x, const CharT* s) { @@ -2592,7 +2592,7 @@ template inline return y; } -template inline +template inline basic_string operator+ (basic_string x, const CharT c) { @@ -2736,7 +2736,7 @@ inline void swap(basic_string& x, basic_string @@ -2774,9 +2774,9 @@ operator<<(std::basic_ostream& os, const basic_stringsputn(s.data(), std::streamsize(n)) == std::streamsize(n); @@ -2828,7 +2828,7 @@ operator>>(std::basic_istream& is, basic_string>(std::basic_istream& is, basic_string +template std::basic_istream& getline(std::istream& is, basic_string& s,CharT delim) { @@ -2871,7 +2871,7 @@ getline(std::istream& is, basic_string& s,CharT delim) return is; } -template +template inline std::basic_istream& getline(std::basic_istream& is, basic_string& s) { diff --git a/include/boost/container/vector.hpp b/include/boost/container/vector.hpp index 8dc2e68..ed198d8 100644 --- a/include/boost/container/vector.hpp +++ b/include/boost/container/vector.hpp @@ -103,7 +103,7 @@ class vec_iterator #ifndef NDEBUG : m_ptr() #else - // No value initialization of m_ptr() to speed up things a bit: + // No value initialization of m_ptr() to speed up things a bit: #endif {} @@ -790,7 +790,7 @@ class vector boost::container::destroy_alloc_n (this->get_stored_allocator(), container_detail::to_raw_pointer(this->m_holder.start()), this->m_holder.m_size); //vector_alloc_holder deallocates the data - } + } //! Effects: Makes *this contain the same elements as x. //! @@ -930,7 +930,7 @@ class vector const size_type input_sz = static_cast(std::distance(first, last)); const size_type old_capacity = this->capacity(); if(input_sz > old_capacity){ //If input range is too big, we need to reallocate - size_type real_cap; + size_type real_cap = 0; std::pair ret = this->m_holder.allocation_command(allocate_new, input_sz, input_sz, real_cap, this->m_holder.start()); if(!ret.second){ //New allocation, just emplace new values @@ -945,7 +945,7 @@ class vector this->priv_uninitialized_construct_at_end(first, last); return; } - else{ + else{ //Forward expansion, use assignment + back deletion/construction that comes later } } @@ -1426,7 +1426,7 @@ class vector #else BOOST_MOVE_CONVERSION_AWARE_CATCH(push_back, T, void, priv_push_back) #endif - + #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED) //! Requires: position must be a valid iterator of *this. //! @@ -2202,7 +2202,7 @@ class vector // //Old situation: // first_pos last_pos old_limit - // | | | + // | | | // ____________V_______V__________________V_____________ //| prefix | range | suffix |raw_mem ~ //|____________|_______|__________________|_____________~ @@ -2211,19 +2211,19 @@ class vector // range is moved through move assignments // // first_pos last_pos limit_pos - // | | | + // | | | // ____________V_______V__________________V_____________ //| prefix' | | | range |suffix'|raw_mem ~ //|________________+______|___^___|_______|_____________~ // | | - // |_>_>_>_>_>^ + // |_>_>_>_>_>^ // // //New situation in Case B (hole_size > 0): // range is moved through uninitialized moves // // first_pos last_pos limit_pos - // | | | + // | | | // ____________V_______V__________________V________________ //| prefix' | | | [hole] | range | //|_______________________________________|________|___^___| @@ -2234,7 +2234,7 @@ class vector // range is moved through move assignments and uninitialized moves // // first_pos last_pos limit_pos - // | | | + // | | | // ____________V_______V__________________V___ //| prefix' | | | range | //|___________________________________|___^___| diff --git a/index.html b/index.html index fe55e4d..c0373e9 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,7 @@ file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -Automatic redirection failed, please go to +Automatic redirection failed, please go to ../../doc/html/container.html diff --git a/src/dlmalloc_ext_2_8_6.c b/src/dlmalloc_ext_2_8_6.c index 813f3e0..a418b3a 100644 --- a/src/dlmalloc_ext_2_8_6.c +++ b/src/dlmalloc_ext_2_8_6.c @@ -485,7 +485,7 @@ static void internal_multialloc_free(mstate m, boost_cont_memchain *pchain) /* lcm is an algorithm that calculates the least common multiple of two integers. - + Pre: A > 0 && B > 0 Recommended: A > B*/ #define CALCULATE_LCM(A, B, OUT)\ @@ -520,7 +520,7 @@ static int calculate_lcm_and_needs_backwards_lcmed lcm = max; /*If we want to use minbytes data to get a buffer between maxbytes - and minbytes if maxbytes can't be achieved, calculate the + and minbytes if maxbytes can't be achieved, calculate the biggest of all possibilities*/ current_forward = GET_TRUNCATED_PO2_SIZE(received_size, backwards_multiple); needs_backwards = size_to_achieve - current_forward; @@ -578,7 +578,7 @@ static int calculate_lcm_and_needs_backwards_lcmed else{ CALCULATE_LCM(max, min, lcm); /*If we want to use minbytes data to get a buffer between maxbytes - and minbytes if maxbytes can't be achieved, calculate the + and minbytes if maxbytes can't be achieved, calculate the biggest of all possibilities*/ current_forward = GET_TRUNCATED_SIZE(received_size, backwards_multiple); needs_backwards = size_to_achieve - current_forward; @@ -682,7 +682,7 @@ static void *internal_grow_both_sides int prev_was_dv = prev == m->dv; assert(newprevsize >= MIN_CHUNK_SIZE); - + if (prev_was_dv) { m->dvsize = newprevsize; } @@ -691,7 +691,7 @@ static void *internal_grow_both_sides insert_chunk(m, prev, newprevsize); } - set_size_and_pinuse_of_free_chunk(prev, newprevsize); + set_size_and_pinuse_of_free_chunk(prev, newprevsize); clear_pinuse(r); set_inuse(m, r, rsize); check_malloced_chunk(m, chunk2mem(r), rsize); @@ -762,7 +762,7 @@ static int internal_mmap_shrink_in_place(mstate m, mchunkptr oldp, size_t nbmin, if(!do_commit){ const int flags = 0; /* placate people compiling -Wunused */ char* cp = (char*)CALL_MREMAP((char*)oldp - offset, - oldmmsize, newmmsize, flags); + oldmmsize, newmmsize, flags); /*This must always succeed */ if(!cp){ USAGE_ERROR_ACTION(m, m); @@ -822,7 +822,7 @@ static int internal_shrink(mstate m, void* oldmem, size_t minbytes, size_t maxby ok_next(oldp, next) && ok_pinuse(next))) { size_t nbmin = request2size(minbytes); size_t nbmax = request2size(maxbytes); - + if (nbmin > oldsize){ /* Return error if old size is too small */ } @@ -880,8 +880,8 @@ static int internal_node_multialloc if( !element_size || /*OR Error if n_elements less thatn contiguous_elements */ ((contiguous_elements + 1) > (DL_MULTIALLOC_DEFAULT_CONTIGUOUS + 1) && n_elements < contiguous_elements) || - /* OR Error if integer overflow */ - (SQRT_MAX_SIZE_T < (element_req_size | contiguous_elements) && + /* OR Error if integer overflow */ + (SQRT_MAX_SIZE_T < (element_req_size | contiguous_elements) && (MAX_SIZE_T/element_req_size) < contiguous_elements)){ return 0; } @@ -1201,7 +1201,7 @@ BOOST_CONTAINER_DECL boost_cont_malloc_stats_t boost_cont_malloc_stats() } else { boost_cont_malloc_stats_t r = { 0, 0, 0 }; - USAGE_ERROR_ACTION(ms,ms); + USAGE_ERROR_ACTION(ms,ms); return r; } } diff --git a/test/alloc_basic_test.cpp b/test/alloc_basic_test.cpp index 757af76..69dcdb7 100644 --- a/test/alloc_basic_test.cpp +++ b/test/alloc_basic_test.cpp @@ -28,7 +28,7 @@ bool basic_test() if(boost_cont_all_deallocated()) return false; - + boost_cont_grow(ptr, received + 20, received + 30, &received); if(boost_cont_allocated_memory() != boost_cont_chunksize(ptr)) diff --git a/test/alloc_full_test.cpp b/test/alloc_full_test.cpp index 0553c8b..fef26ba 100644 --- a/test/alloc_full_test.cpp +++ b/test/alloc_full_test.cpp @@ -83,7 +83,7 @@ bool test_allocation() } if(!boost_cont_all_deallocated()) return false; - //bool ok = free_memory == a.get_free_memory() && + //bool ok = free_memory == a.get_free_memory() && //a.all_memory_deallocated() && a.check_sanity(); //if(!ok) return ok; } @@ -137,7 +137,7 @@ bool test_allocation_shrink() } } } - + //Deallocate it in non sequential order for(int j = 0, max = (int)buffers.size() ;j < max @@ -187,7 +187,7 @@ bool test_allocation_expand() preferred_size = min_size*2; } } - + //Deallocate it in non sequential order for(int j = 0, max = (int)buffers.size() ;j < max @@ -262,7 +262,7 @@ bool test_allocation_shrink_and_expand() return false; } } - + //Deallocate it in non sequential order for(int j = 0, max = (int)buffers.size() ;j < max @@ -328,7 +328,7 @@ bool test_allocation_deallocation_expand() } } } - + //Now erase null values from the vector buffers.erase(std::remove(buffers.begin(), buffers.end(), (void*)0) ,buffers.end()); @@ -366,7 +366,7 @@ bool test_allocation_with_reuse() break; buffers.push_back(ptr); } - + //Now deallocate all except the latest //Now try to expand to the double of the size for(int i = 0, max = (int)buffers.size() - 1 @@ -421,7 +421,7 @@ bool test_aligned_allocation() if(!ptr){ return false; } - + if(((std::size_t)ptr & (j - 1)) != 0) return false; boost_cont_free(ptr); @@ -455,7 +455,7 @@ bool test_continuous_aligned_allocation() continue_loop = false; break; } - + if(((std::size_t)ptr & (j - 1)) != 0) return false; } @@ -576,7 +576,7 @@ bool test_many_equal_allocation() buffers2.erase(buffers2.begin()+pos); } - //bool ok = free_memory == a.get_free_memory() && + //bool ok = free_memory == a.get_free_memory() && //a.all_memory_deallocated() && a.check_sanity(); //if(!ok) return ok; } @@ -684,7 +684,7 @@ bool test_many_different_allocation() buffers2.erase(buffers2.begin()+pos); } - //bool ok = free_memory == a.get_free_memory() && + //bool ok = free_memory == a.get_free_memory() && //a.all_memory_deallocated() && a.check_sanity(); //if(!ok) return ok; } diff --git a/test/check_equal_containers.hpp b/test/check_equal_containers.hpp index b5b2a2f..a0704e7 100644 --- a/test/check_equal_containers.hpp +++ b/test/check_equal_containers.hpp @@ -25,7 +25,7 @@ namespace test{ template< class T1, class T2> bool CheckEqual( const T1 &t1, const T2 &t2 , typename boost::container::container_detail::enable_if_c - ::value && + ::value && !boost::container::container_detail::is_pair::value >::type* = 0) { return t1 == t2; } @@ -50,7 +50,7 @@ bool CheckEqualIt( const T1 &i1, const T2 &i2, const C1 &c1, const C2 &c2 ) template< class Pair1, class Pair2> bool CheckEqual( const Pair1 &pair1, const Pair2 &pair2 , typename boost::container::container_detail::enable_if_c - ::value && + ::value && boost::container::container_detail::is_pair::value >::type* = 0) { diff --git a/test/deque_test.cpp b/test/deque_test.cpp index 871dbd6..71527f3 100644 --- a/test/deque_test.cpp +++ b/test/deque_test.cpp @@ -288,11 +288,11 @@ bool do_test() cntdeque->resize(100); stddeque->resize(100); - if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1; + if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1; cntdeque->resize(200); stddeque->resize(200); - if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1; + if(!test::CheckEqualContainers(cntdeque, stddeque)) return 1; delete cntdeque; delete stddeque; @@ -304,7 +304,7 @@ bool do_test() return false; } BOOST_CATCH_END - + std::cout << std::endl << "Test OK!" << std::endl; return true; } diff --git a/test/expand_bwd_test_allocator.hpp b/test/expand_bwd_test_allocator.hpp index 745fc53..f7ba304 100644 --- a/test/expand_bwd_test_allocator.hpp +++ b/test/expand_bwd_test_allocator.hpp @@ -108,7 +108,7 @@ class expand_bwd_test_allocator { return m_size; } friend void swap(self_t &alloc1, self_t &alloc2) - { + { boost::container::swap_dispatch(alloc1.mp_buffer, alloc2.mp_buffer); boost::container::swap_dispatch(alloc1.m_size, alloc2.m_size); boost::container::swap_dispatch(alloc1.m_offset, alloc2.m_offset); @@ -125,7 +125,7 @@ class expand_bwd_test_allocator (void)preferred_size; (void)reuse; (void)command; //This allocator only expands backwards! assert(m_allocations == 0 || (command & boost::container::expand_bwd)); - + received_size = limit_size; if(m_allocations == 0){ diff --git a/test/list_test.hpp b/test/list_test.hpp index 0ce580b..5de5711 100644 --- a/test/list_test.hpp +++ b/test/list_test.hpp @@ -299,7 +299,7 @@ int list_test (bool copied_allocators_equal = true) boostlist->splice(boostlist->begin(), otherboostlist); stdlist->splice(stdlist->begin(), otherstdlist); if(!CheckEqualContainers(boostlist, stdlist)) - return 1; + return 1; } listsize = (int)boostlist->size(); diff --git a/test/map_test.cpp b/test/map_test.cpp index 565d2b1..fc9363f 100644 --- a/test/map_test.cpp +++ b/test/map_test.cpp @@ -229,7 +229,7 @@ class map_propagate_test_wrapper < T, T, std::less , typename boost::container::allocator_traits::template portable_rebind_alloc< std::pair >::type - //tree_assoc_defaults + //tree_assoc_defaults > { BOOST_COPYABLE_AND_MOVABLE(map_propagate_test_wrapper) diff --git a/test/map_test.hpp b/test/map_test.hpp index 98e1ba5..115be9c 100644 --- a/test/map_test.hpp +++ b/test/map_test.hpp @@ -110,7 +110,7 @@ int map_test_copyable(boost::container::container_detail::true_type) stdmapcopy = *stdmap; boostmmapcopy = *boostmultimap; stdmmapcopy = *stdmultimap; - + if(!CheckEqualContainers(&boostmapcopy, &stdmapcopy)) return 1; if(!CheckEqualContainers(&boostmmapcopy, &stdmmapcopy)) @@ -145,7 +145,7 @@ int map_test() MyBoostMultiMap *boostmultimap = new MyBoostMultiMap; MyStdMultiMap *stdmultimap = new MyStdMultiMap; - //Test construction from a range + //Test construction from a range { //This is really nasty, but we have no other simple choice IntPairType aux_vect[50]; @@ -491,7 +491,7 @@ int map_test() std::pair sret = stdmultimap->equal_range(stdmultimap->begin()->first); - + if( std::distance(bret.first, bret.second) != std::distance(sret.first, sret.second) ){ return 1; diff --git a/test/movable_int.hpp b/test/movable_int.hpp index 1daf02a..dd0b343 100644 --- a/test/movable_int.hpp +++ b/test/movable_int.hpp @@ -121,7 +121,7 @@ class movable_and_copyable_int movable_and_copyable_int(const movable_and_copyable_int& mmi) : m_int(mmi.m_int) {} - + movable_and_copyable_int(BOOST_RV_REF(movable_and_copyable_int) mmi) : m_int(mmi.m_int) { mmi.m_int = 0; } @@ -201,7 +201,7 @@ class copyable_int copyable_int(const copyable_int& mmi) : m_int(mmi.m_int) {} - + copyable_int & operator= (int i) { this->m_int = i; return *this; } diff --git a/test/print_container.hpp b/test/print_container.hpp index 4a09cdc..728a6f7 100644 --- a/test/print_container.hpp +++ b/test/print_container.hpp @@ -52,7 +52,7 @@ void PrintContainers(MyBoostCont *boostcont, MyStdCont *stdcont) std::cout << *itboost << std::endl; } std::cout << "MyStdCont" << std::endl; - + for(; itstd != itstdend; ++itstd){ std::cout << *itstd << std::endl; } diff --git a/test/scoped_allocator_adaptor_test.cpp b/test/scoped_allocator_adaptor_test.cpp index 990f81e..9ccbb72 100644 --- a/test/scoped_allocator_adaptor_test.cpp +++ b/test/scoped_allocator_adaptor_test.cpp @@ -723,7 +723,7 @@ int main() } { - vector > > dummy; + vector > > dummy; dummy.push_back(0); } diff --git a/test/scoped_allocator_usage_test.cpp b/test/scoped_allocator_usage_test.cpp index 058d997..42a62ea 100644 --- a/test/scoped_allocator_usage_test.cpp +++ b/test/scoped_allocator_usage_test.cpp @@ -238,7 +238,7 @@ struct container_wrapper : public Container { typedef typename Container::allocator_type allocator_type; - + container_wrapper(const allocator_type &a) : Container(a) {} diff --git a/test/set_test.cpp b/test/set_test.cpp index d613421..3cd58ad 100644 --- a/test/set_test.cpp +++ b/test/set_test.cpp @@ -205,7 +205,7 @@ void test_move() template class set_propagate_test_wrapper : public boost::container::set, A - //tree_assoc_defaults + //tree_assoc_defaults > { BOOST_COPYABLE_AND_MOVABLE(set_propagate_test_wrapper) diff --git a/test/set_test.hpp b/test/set_test.hpp index 56fb4a0..b10834a 100644 --- a/test/set_test.hpp +++ b/test/set_test.hpp @@ -99,7 +99,7 @@ int set_test_copyable(boost::container::container_detail::true_type) boostmsetcopy = *boostmultiset; stdmsetcopy = *stdmultiset; - + if(!CheckEqualContainers(&boostmsetcopy, &stdmsetcopy)) return 1; } @@ -128,7 +128,7 @@ int set_test () MyBoostMultiSet *boostmultiset = new MyBoostMultiSet; MyStdMultiSet *stdmultiset = new MyStdMultiSet; - //Test construction from a range + //Test construction from a range { IntType aux_vect[50]; for(int i = 0; i < 50; ++i){ diff --git a/test/string_test.cpp b/test/string_test.cpp index b44f7ef..caa7eac 100644 --- a/test/string_test.cpp +++ b/test/string_test.cpp @@ -216,15 +216,15 @@ int string_test() boost_swapper.swap(auxBoostString); std_swapper.swap(auxStdString); if(!StringEqual()(auxBoostString, auxStdString)) - return 1; + return 1; if(!StringEqual()(boost_swapper, std_swapper)) - return 1; + return 1; boost_swapper.swap(auxBoostString); std_swapper.swap(auxStdString); if(!StringEqual()(auxBoostString, auxStdString)) - return 1; + return 1; if(!StringEqual()(boost_swapper, std_swapper)) - return 1; + return 1; //Shrink_to_fit auxBoostString.shrink_to_fit(); @@ -251,7 +251,7 @@ int string_test() boost_swapper.swap(auxBoostString); std_swapper.swap(auxStdString); if(!StringEqual()(auxBoostString, auxStdString)) - return 1; + return 1; if(!StringEqual()(boost_swapper, std_swapper)) return 1; boost_swapper.swap(auxBoostString); diff --git a/test/vector_test.hpp b/test/vector_test.hpp index c3e92e6..8a5ccdd 100644 --- a/test/vector_test.hpp +++ b/test/vector_test.hpp @@ -114,15 +114,15 @@ int vector_test() MyStdVector *stdvector = new MyStdVector; boostvector->resize(100); stdvector->resize(100); - if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; + if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(200); stdvector->resize(200); - if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; + if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; boostvector->resize(0); stdvector->resize(0); - if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; + if(!test::CheckEqualContainers(boostvector, stdvector)) return 1; for(int i = 0; i < max; ++i){ IntType new_int(i);