[#bsl-List_AllocAndSizeWrapper]
= xref:bsl.adoc[bsl]::List&lowbar;AllocAndSizeWrapper
:relfileprefix: ../
:mrdocs:

Wrapper holding a list&apos;s allocator and size, using EBO when possible&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;list&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class VALUE,
    class ALLOCATOR&gt;
class List&lowbar;AllocAndSizeWrapper
    : public allocator&lowbar;traits&lt;ALLOCATOR&gt;::rebind&lowbar;traits&lt;List&lowbar;Node&lt;VALUE&gt;&gt;::allocator&lowbar;type
----

== Description

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

TBD&colon; This struct should eventually be replaced by the use of a general EBO&hyphen;enabled component that provides a `pair`&hyphen;like interface&period; (A properly&hyphen;optimized `tuple` would do the job&period;)

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `allocator&lowbar;traits&lt;ALLOCATOR&gt;::rebind&lowbar;traits&lt;List&lowbar;Node&lt;VALUE&gt;&gt;::allocator&lowbar;type`
| 
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:bsl/List_AllocAndSizeWrapper/2constructor.adoc[`List&lowbar;AllocAndSizeWrapper`]         [.small]#[constructor]#
| Create an allocator and size wrapper with `basicAllocator` and `size`&period;
| xref:bsl/List_AllocAndSizeWrapper/size-0a.adoc[`size`] 
| Return a reference providing modifiable access to the `size` field of this object&period;
| xref:bsl/List_AllocAndSizeWrapper/size-08.adoc[`size`] 
| Return a reference providing non&hyphen;modifiable access to the `size` field of this object&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
