[#BloombergLP-bdlcc-FixedQueueIndexManager-reservePopIndexForClear]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/FixedQueueIndexManager.adoc[FixedQueueIndexManager]::reservePopIndexForClear
:relfileprefix: ../../../
:mrdocs:

If the next available index from which an element can be popped is before the specified `endGeneration` and `endIndex` then reserve that index for popping and load the specified `disposedGeneration` and `disposedIndex` with the generation and index of the reserved cell&semi; otherwise this operation has no effect&period; Return 0 if an index was successfully reserved, and a non&hyphen;zero value if the current pop index is at `endIndex` and `endGeneration`&period; The behavior is undefined unless `endGeneration` and `endIndex` refer to a cell that has been acquired for writing&period; Note that this operation is used to facilitate removing all the elements in a circular buffer if an exception is thrown between reserving an index for pushing, and committing that index &hyphen;&hyphen; the intended usage is to call `reservePopIndexForClear` and then `commitPopIndex`, emptying all the cells up to the index that was reserved for writing, and then call `abortPushIndexReservation` on the reserved index&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
reservePopIndexForClear(
    unsigned int* disposedGeneration,
    unsigned int* disposedIndex,
    unsigned int endGeneration,
    unsigned int endIndex);
----


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