Stroika Library
3.0d18
Help-Home
Loading...
Searching...
No Matches
StdVectorSupport.inl
1
/*
2
* Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3
*/
4
#include "
Stroika/Foundation/Debug/Assertions.h
"
5
#include "
Stroika/Foundation/Debug/Cast.h
"
6
7
namespace
Stroika::Foundation::Containers::Private
{
8
9
/*
10
********************************************************************************
11
********* StdVectorBasedContainer<THIS_CONTAINER,BASE_CONTAINER> ***************
12
********************************************************************************
13
*/
14
template
<
typename
THIS_CONTAINER,
typename
BASE_CONTAINER>
15
inline
size_t
StdVectorBasedContainer<THIS_CONTAINER, BASE_CONTAINER>::capacity ()
const
16
{
17
using
_SafeReadRepAccessor =
typename
THIS_CONTAINER ::template _SafeReadRepAccessor<typename THIS_CONTAINER::Rep_>;
18
return
_SafeReadRepAccessor{
this
}._ConstGetRep ().fData_.capacity ();
19
}
20
template
<
typename
THIS_CONTAINER,
typename
BASE_CONTAINER>
21
inline
void
StdVectorBasedContainer<THIS_CONTAINER, BASE_CONTAINER>::reserve
(
size_t
slotsAlloced)
22
{
23
using
_SafeReadWriteRepAccessor =
typename
THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
24
return
_SafeReadWriteRepAccessor{
this
}._GetWriteableRep ().fData_.reserve (slotsAlloced);
25
}
26
template
<
typename
THIS_CONTAINER,
typename
BASE_CONTAINER>
27
inline
void
StdVectorBasedContainer<THIS_CONTAINER, BASE_CONTAINER>::shrink_to_fit
()
28
{
29
using
_SafeReadWriteRepAccessor =
typename
THIS_CONTAINER ::template _SafeReadWriteRepAccessor<typename THIS_CONTAINER::Rep_>;
30
return
_SafeReadWriteRepAccessor{
this
}._GetWriteableRep ().fData_.shrink_to_fit ();
31
}
32
33
}
Assertions.h
Cast.h
Stroika::Foundation::Containers::Private::StdVectorBasedContainer::reserve
nonvirtual void reserve(size_t slotsAlloced)
Definition
StdVectorSupport.inl:21
Stroika::Foundation::Containers::Private::StdVectorBasedContainer::shrink_to_fit
nonvirtual void shrink_to_fit()
Reduce the space used to store the container contents.
Definition
StdVectorSupport.inl:27
Stroika::Foundation::Containers::Private
Definition
ArraySupport.h:20
Library
Sources
Stroika
Foundation
Containers
Private
StdVectorSupport.inl
Generated by
1.9.8