BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR > Class Template Reference

#include <bslstl_list.h>

Inheritance diagram for bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR >:

Public Member Functions

 List_AllocAndSizeWrapper (const NodeAlloc &basicAllocator, size_type size)
 
size_type & size ()
 
const size_type & size () const
 

Detailed Description

template<class VALUE, class ALLOCATOR>
class bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR >

This struct is a wrapper around the allocator and size data members of a list. It takes advantage of the empty-base optimization (EBO) so that if the allocator is stateless, it takes up no space.

TBD: This struct should eventually be replaced by the use of a general EBO-enabled component that provides a pair-like interface. (A properly-optimized tuple would do the job.)

Constructor & Destructor Documentation

◆ List_AllocAndSizeWrapper()

template<class VALUE , class ALLOCATOR >
bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR >::List_AllocAndSizeWrapper ( const NodeAlloc &  basicAllocator,
size_type  size 
)
inline

Create an allocator and size wrapper having the specified basicAllocator and (initial) size.

Member Function Documentation

◆ size() [1/2]

template<class VALUE , class ALLOCATOR >
List_AllocAndSizeWrapper< VALUE, ALLOCATOR >::size_type & bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR >::size ( )
inline

Return a reference providing modifiable access to the size field of this object.

◆ size() [2/2]

template<class VALUE , class ALLOCATOR >
const List_AllocAndSizeWrapper< VALUE, ALLOCATOR >::size_type & bsl::List_AllocAndSizeWrapper< VALUE, ALLOCATOR >::size ( ) const
inline

Return a reference providing non-modifiable access to the size field of this object.


The documentation for this class was generated from the following file: