|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r82447 - in sandbox/static_vector: boost/container doc
From: athundt_at_[hidden]
Date: 2013-01-11 01:16:03
Author: ahundt
Date: 2013-01-11 01:16:01 EST (Fri, 11 Jan 2013)
New Revision: 82447
URL: http://svn.boost.org/trac/boost/changeset/82447
Log:
static_vector improved documentation formatting.
Text files modified:
sandbox/static_vector/boost/container/static_vector.hpp | 2 +-
sandbox/static_vector/doc/static_vector.qbk | 26 ++++++++++++++++++++++----
2 files changed, 23 insertions(+), 5 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 2013-01-11 01:16:01 EST (Fri, 11 Jan 2013)
@@ -164,7 +164,7 @@
} // namespace static_vector_detail
/**
- * @brief A hybrid of \c boost::container::vector and \c boost::array.
+ * @brief A hybrid of \c boost::container::vector and \c boost::array with fixed capacity.
*
* static_vector is a sequence container like boost::container::vector with contiguous storage that can
* change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
Modified: sandbox/static_vector/doc/static_vector.qbk
==============================================================================
--- sandbox/static_vector/doc/static_vector.qbk (original)
+++ sandbox/static_vector/doc/static_vector.qbk 2013-01-11 01:16:01 EST (Fri, 11 Jan 2013)
@@ -24,17 +24,35 @@
[section:introduction Introduction]
-static_vector is a hybrid of boost::container::vector and boost::array.
+static_vector is hybrid of boost::container::vector and boost::array with fixed capacity.
static_vector is a sequence container like boost::container::vector with contiguous storage that can
-change in size, but provides the static allocation, low overhead, and fixed capacity of boost::array.
+change in size, along with the static allocation, low overhead, and fixed capacity of boost::array.
+[heading Example]
[import ../example/static_vector_example.cpp]
[static_vector_example_cpp]
-static_vector is well suited for use in a buffer or in the internal implementation of 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 are a particular case where static_vector is most useful, where allocation either may not be available or acceptable.
+[heading Behavior]
+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.
+
+[heading Runtime Complexity]
+ * 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.
+
+[heading Use Cases]
+static_vector is well suited for use in a buffer, the internal implementation of 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.
-Exceptions can be disabled for cases where it is not supported or not desired.
+Exceptions can be disabled for cases where they are either not supported or desired.
[endsect]
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