Update small_vector documentation + update links to Howard Hinnant's papers.

This commit is contained in:
Ion Gaztañaga
2015-03-08 08:53:23 +01:00
parent b31b738de7
commit 02e8762afe
3 changed files with 98 additions and 61 deletions
+20 -4
View File
@@ -514,6 +514,21 @@ are a particular case where `static_vector` can be beneficial.
[endsect]
[section:small_vector ['small_vector]]
`small_vector` is a vector-like container optimized for the case when it contains few elements.
It contains some preallocated elements in-place, which allows it to avoid the use of dynamic storage allocation
when the actual number of elements is below that preallocated threshold. `small_vector` is inspired by
[@http://llvm.org/docs/ProgrammersManual.html#llvm-adt-smallvector-h LLVM's `SmallVector`] container.
Unlike `static_vector`, `small_vector`'s capacity can grow beyond the initial preallocated capacity.
`small_vector<T, N, Allocator>` is convertible to `small_vector_base<T, Allocator>`, a type that is independent
from the preallocated element count, allowing client code that does not need to be templated on that N argument.
`small_vector` inherits all `vector`'s member functions so it supports all standard features like emplacement,
stateful allocators, etc.
[endsect]
[endsect]
[section:extended_functionality Extended functionality]
@@ -596,7 +611,7 @@ used to customize these containers:
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
[@http://home.roadrunner.com/~hinnant/On_list_size.html ['On List Size]] paper:
[@http://howardhinnant.github.io/On_list_size.html ['On List Size]] paper:
[: ['There is a considerable debate on whether `std::list<T>::size()` should be O(1) or O(N).
The usual argument notes that it is a tradeoff with:]
@@ -899,7 +914,7 @@ unsuccessful tries to deprecate or remove it from the standard. [*Boost.Containe
as there is a superior [@http://www.boost.org/libs/dynamic_bitset/ Boost.DynamicBitset]
solution. For issues with `vector<bool>` see the following papers:
* [@http://home.roadrunner.com/~hinnant/onvectorbool.html On `vector<bool>`]
* [@http://howardhinnant.github.io/onvectorbool.html On `vector<bool>`]
* [@http://www.gotw.ca/publications/N1211.pdf vector<bool>: N1211: More Problems, Better Solutions],
* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2160.html N2160: Library Issue 96: Fixing vector<bool>],
* [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2204.html N2204 A Specification to deprecate vector<bool>].
@@ -1082,15 +1097,16 @@ use [*Boost.Container]? There are several reasons for that:
[section:release_notes Release Notes]
[section:release_notes_boost_1_58_00 Boost 1.58 Release]
* Massive dependency reorganization. Now [*Boost.Container depends on very basic utilities like Boost.Core
* Experimental [classref boost::container::small_vector small_vector] container.
* Massive dependency reorganization. Now [*Boost.Container] depends on very basic utilities like Boost.Core
and [*Boost.Intrusive]. Preprocessed code size have decreased considerably and compilation times have improved.
* Added `nth` and `index_of` functions to containers with random-access iterators (except `basic_string`).
* Added C++17's `allocator_traits<Allocator>::is_always_equal`.
* Experimental [classref boost::container::small_vector small_vector] container.
* Updated containers to implement new constructors as specified in
[@http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2210 2210. Missing allocator-extended constructor for allocator-aware containers].
* Fixed bugs:
* [@https://svn.boost.org/trac/boost/ticket/9931 #9931: ['"flat_map::insert(ordered_unique_range_t...) fails with move_iterators"]] (reopened).
* [@https://svn.boost.org/trac/boost/ticket/11076 #11076: ['"Unqualified calls to memmove/memcpy in container/detail/copy_move_algo.hpp"]].
* [@https://svn.boost.org/trac/boost/ticket/10790 Trac #10790 (['long long errors from container"])].
* [@https://svn.boost.org/trac/boost/ticket/10808 Trac #10808 (['compare equal operator of vector is broken"])].
* [*Source Breaking]: [classref boost::container::scoped_allocator_adaptor scoped_allocator_adaptor]'s