[#BloombergLP-bdlcc-Queue-tryPopFront-039]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/Queue.adoc[Queue]::tryPopFront
:relfileprefix: ../../../
:mrdocs:

`tryPopFront` overloads

== Synopses

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

Remove up to the specified `maxNumItems` from the front of this queue&period; Optionally specify a `buffer` into which the items removed from the queue 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(popFront())` while the queue is not empty and `maxNumItems` have not yet been removed&period; The behavior is undefined unless `maxNumItems &gt;&equals; 0`&period; This method never blocks&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Queue/tryPopFront-05.adoc[tryPopFront](int maxNumItems);
----

[.small]#xref:BloombergLP/bdlcc/Queue/tryPopFront-05.adoc[_» more&period;&period;&period;_]#

If this queue is non&hyphen;empty, remove the first item, load that item into the specified `buffer`, and return 0 indicating success&period; If this queue is empty, return a non&hyphen;zero value with no effect on `buffer` or the state of this queue&period; This method never blocks&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
xref:BloombergLP/bdlcc/Queue/tryPopFront-09.adoc[tryPopFront](TYPE* buffer);
----

[.small]#xref:BloombergLP/bdlcc/Queue/tryPopFront-09.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, appending removed items to `buffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Queue/tryPopFront-01.adoc[tryPopFront](
    int maxNumItems,
    xref:bsl/vector-00d.adoc[bsl::vector&lt;TYPE&gt;]* buffer);
----

[.small]#xref:BloombergLP/bdlcc/Queue/tryPopFront-01.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, appending removed items to `buffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Queue/tryPopFront-031.adoc[tryPopFront](
    int maxNumItems,
    std::pmr::vector&lt;TYPE&gt;* buffer);
----

[.small]#xref:BloombergLP/bdlcc/Queue/tryPopFront-031.adoc[_» more&period;&period;&period;_]#

Same as the preceding overload, appending removed items to `buffer`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlcc/Queue/tryPopFront-04.adoc[tryPopFront](
    int maxNumItems,
    std::vector&lt;TYPE&gt;* buffer);
----

[.small]#xref:BloombergLP/bdlcc/Queue/tryPopFront-04.adoc[_» more&period;&period;&period;_]#


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