[#BloombergLP-bslmt-OnceGuard-2constructor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/OnceGuard.adoc[OnceGuard]::OnceGuard :relfileprefix: ../../../ :mrdocs: Create a guard optionally associated with the specified `once` object. == Synopsis Declared in `<bslmt_once.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit OnceGuard(xref:BloombergLP/bslmt/Once.adoc[Once]* once = 0); ---- == Description Initialize this object to guard the (optionally) specified `once` object. If `once` is not specified, then it must be set later using the `setOnce` method before other methods may be called. == Parameters [cols="1,4"] |=== | Name| Description | *once* | optional `Once` object to guard; may be null |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#