forked from boostorg/container
Added stored_size option to static_vector
This commit is contained in:
@@ -33,6 +33,14 @@ int main ()
|
||||
//Create static_vector with no throw on overflow
|
||||
static_vector<int, 10, no_throw_options_t > sv2;
|
||||
|
||||
//This options specifies that internal `size()` can be represented by an unsigned char
|
||||
//instead of the default `std::size_t`.
|
||||
typedef static_vector_options< stored_size<unsigned char> >::type stored_size_uchar_t;
|
||||
|
||||
//Create static_vector that internally stores `size()` in an unsigned char
|
||||
//because `capacity()` will be less thatn 256.
|
||||
static_vector<unsigned char, 10, stored_size_uchar_t> sv3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
//]
|
||||
|
||||
Reference in New Issue
Block a user