mirror of
https://github.com/boostorg/container.git
synced 2026-02-23 15:42:17 +00:00
Make customization example more clear with a heading before each option
This commit is contained in:
@@ -20,9 +20,10 @@ int main ()
|
||||
{
|
||||
using namespace boost::container;
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// 'stored_size' option
|
||||
////////////////////////////////////////////////
|
||||
//--------------------------------------------
|
||||
// 'stored_size' option
|
||||
//--------------------------------------------
|
||||
|
||||
//Specify that a devector will use "unsigned char" as the type to store size/capacity
|
||||
typedef devector_options< stored_size<unsigned char> >::type size_option_t;
|
||||
|
||||
@@ -43,9 +44,10 @@ int main ()
|
||||
//=catch(...){ exception_thrown = true; }
|
||||
assert(exception_thrown == true);
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// 'growth_factor' option
|
||||
////////////////////////////////////////////////
|
||||
//--------------------------------------------
|
||||
// 'growth_factor' option
|
||||
//--------------------------------------------
|
||||
|
||||
//Specify that a devector will increase its capacity 50% when reallocating
|
||||
typedef devector_options< growth_factor<growth_factor_50> >::type growth_50_option_t;
|
||||
|
||||
@@ -58,9 +60,9 @@ int main ()
|
||||
growth_50_dv.push_back(1);
|
||||
assert(growth_50_dv.capacity() == old_cap*3/2);
|
||||
|
||||
////////////////////////////////////////////////
|
||||
// 'relocate_on' option
|
||||
////////////////////////////////////////////////
|
||||
//--------------------------------------------
|
||||
// 'relocate_on' option
|
||||
//--------------------------------------------
|
||||
|
||||
//Specifies that a devector will not reallocate but relocate elements if the free space
|
||||
//at one end is exhausted and the total load factor is below the 66% threshold.
|
||||
|
||||
Reference in New Issue
Block a user