[#CountingSemaphoreGrant-2constructor-04]
= xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant]::CountingSemaphoreGrant
:relfileprefix: ../
:mrdocs:

Constructors

== Synopses

Declared in `&lt;semaphore&lowbar;grant&period;h&gt;`

Constructs an empty grant that holds no semaphore slot&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CountingSemaphoreGrant/2constructor-06.adoc[CountingSemaphoreGrant]() noexcept;
----

[.small]#xref:CountingSemaphoreGrant/2constructor-06.adoc[_» more&period;&period;&period;_]#

Copy construction is deleted&semi; a grant uniquely owns its slot&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CountingSemaphoreGrant/2constructor-0a.adoc[CountingSemaphoreGrant](xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant] const& other) = delete;
----

[.small]#xref:CountingSemaphoreGrant/2constructor-0a.adoc[_» more&period;&period;&period;_]#

Move&hyphen;constructs a grant, transferring ownership of the held slot&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:CountingSemaphoreGrant/2constructor-05.adoc[CountingSemaphoreGrant](xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant]&& other) noexcept;
----

[.small]#xref:CountingSemaphoreGrant/2constructor-05.adoc[_» more&period;&period;&period;_]#

Constructs a grant bound to a semaphore, optionally acquiring without blocking&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
explicit
xref:CountingSemaphoreGrant/2constructor-02.adoc[CountingSemaphoreGrant](
    std::counting&lowbar;semaphore&lt;LeastMaxValue&gt;& sema,
    bool fTry = false) noexcept;
----

[.small]#xref:CountingSemaphoreGrant/2constructor-02.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *other*
| The grant to move from&semi; left empty afterwards&period;
| *sema*
| The semaphore to acquire a slot from&period;
| *fTry*
| If true, try to acquire without blocking&semi; otherwise block until acquired&period;
|===


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