[#BloombergLP-bdlcc-Deque-tryPopBack-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/Deque.adoc[Deque]::tryPopBack
:relfileprefix: ../../../
:mrdocs:

Remove up to the specified `maxNumItems` from the back of this container&period; Optionally specify a `buffer` into which the items removed from the container are loaded&period; If `buffer` is non&hyphen;null, the removed items are appended to it as if by repeated application of `buffer&hyphen;&gt;push&lowbar;back(popBack())` while the container is not empty and `maxNumItems` have not yet been removed&period; Note that the ordering of the items in `&ast;buffer` after the call is the reverse of the ordering they had in the deque&period; Also note that `&ast;buffer` is not cleared &hyphen;&hyphen; the popped items are appended after any pre&hyphen;existing contents&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;deque&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
tryPopBack(xref:BloombergLP/bdlcc/Deque/size_type.adoc[size&lowbar;type] maxNumItems);
----

== Description

Also note that to transfer the entire contents of a `Deque` `d` to a vector `v`, use `d&period;removeAll(&amp;v)&semi;`&period;


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