[#BloombergLP-bslmt-OnceGuard-enter]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslmt.adoc[bslmt]::xref:BloombergLP/bslmt/OnceGuard.adoc[OnceGuard]::enter
:relfileprefix: ../../../
:mrdocs:

Enter the associated `Once` object&apos;s one&hyphen;time region if allowed&period;

== Synopsis

Declared in `&lt;bslmt&lowbar;once&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
bool
enter();
----

== Description

Call `enter` on the associated `Once` object and return the result&period; If `Once&colon;&colon;enter` returns `true`, set this object into the &quot;in&hyphen;progress&quot; state&period; The behavior is undefined unless this object has been associated with a `Once` object, either in the constructor or using `setOnce`, or if this object is already in the &quot;in&hyphen;progress&quot; state&period;

== Return Value

`true` if this thread entered the one&hyphen;time region, and `false` otherwise


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