BloombergLP::bsls::BslOnceGuard

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>

class BslOnceGuard;

Member Functions

NameDescription
BslOnceGuard [constructor]Create a guard to manage a block of code that is executed once.
~BslOnceGuard [destructor]Destroy this guard.
enter Attempt to enter the one-time block managed by once.
leave Exit the one-time block of code. The behavior is undefined unless the caller had previously called enter, and enter had returned true.