Added stored_size option to static_vector

This commit is contained in:
Ion Gaztañaga
2024-10-12 23:22:59 +02:00
parent c4cfad7402
commit 13603d7de1
6 changed files with 90 additions and 17 deletions
+8
View File
@@ -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;
}
//]