[#BloombergLP-bsls-BslOnceGuard] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::BslOnceGuard :relfileprefix: ../../ :mrdocs: This class provides a guard for managing a `BslOnce` for the purpose of executing a block of code (only) once. == Synopsis Declared in `<bsls_bslonce.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class BslOnceGuard; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bsls/BslOnceGuard/2constructor.adoc[`BslOnceGuard`] [.small]#[constructor]# | Create a guard to manage a block of code that is executed once. | xref:BloombergLP/bsls/BslOnceGuard/2destructor.adoc[`~BslOnceGuard`] [.small]#[destructor]# | Destroy this guard. | xref:BloombergLP/bsls/BslOnceGuard/enter.adoc[`enter`] | Attempt to enter the one‐time block managed by `once`. | xref:BloombergLP/bsls/BslOnceGuard/leave.adoc[`leave`] | Exit the one‐time block of code. The behavior is undefined unless the caller had previously called `enter`, and `enter` had returned `true`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#