Default initialization for vector-like containers

Complexity guarantees for associative container constructors and ordered input ranges
Added benchmark for associative containers
Fixes #9166

[SVN r85964]
This commit is contained in:
Ion Gaztañaga committed 2013-09-26 18:05:25 +00:00
1 parent 59b2793df7
commit 14f092ab00
39 files changed
+1450 -242

No files matched your search

+37 -2
View File
@@ -138,7 +138,7 @@ public:
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Constructs a static_vector containing count default constructed Values.
//! @brief Constructs a static_vector containing count value initialized values.
//!
//! @param count The number of values which will be contained in the container.
//!
@@ -151,6 +151,24 @@ public:
: base_t(count)
{}
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Constructs a static_vector containing count value initialized values.
//!
//! @param count The number of values which will be contained in the container.
//!
//! @par Throws
//! If Value's default constructor throws.
//!
//! @par Complexity
//! Linear O(N).
//!
//! @par Note
//! Non-standard extension
static_vector(size_type count, default_init_t)
: base_t(count, default_init_t())
{}
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Constructs a static_vector containing count copies of value.
@@ -358,7 +376,7 @@ public:
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Inserts or erases elements at the end such that
//! the size becomes count. New elements are default constructed.
//! the size becomes count. New elements are value initialized.
//!
//! @param count The number of elements which will be stored in the container.
//!
@@ -369,6 +387,23 @@ public:
//! Linear O(N).
void resize(size_type count);
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Inserts or erases elements at the end such that
//! the size becomes count. New elements are default initialized.
//!
//! @param count The number of elements which will be stored in the container.
//!
//! @par Throws
//! If Value's default constructor throws.
//!
//! @par Complexity
//! Linear O(N).
//!
//! @par Note
//! Non-standard extension
void resize(size_type count, default_init_t);
//! @pre <tt>count <= capacity()</tt>
//!
//! @brief Inserts or erases elements at the end such that