[#CountingSemaphoreGrant-2constructor-04] = xref:CountingSemaphoreGrant.adoc[CountingSemaphoreGrant]::CountingSemaphoreGrant :relfileprefix: ../ :mrdocs: Constructors == Synopses Declared in `<semaphore_grant.h>` Constructs an empty grant that holds no semaphore slot. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:CountingSemaphoreGrant/2constructor-06.adoc[CountingSemaphoreGrant]() noexcept; ---- [.small]#xref:CountingSemaphoreGrant/2constructor-06.adoc[_» more..._]# Copy construction is deleted; a grant uniquely owns its slot. [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..._]# Move‐constructs a grant, transferring ownership of the held slot. [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..._]# Constructs a grant bound to a semaphore, optionally acquiring without blocking. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- explicit xref:CountingSemaphoreGrant/2constructor-02.adoc[CountingSemaphoreGrant]( std::counting_semaphore<LeastMaxValue>& sema, bool fTry = false) noexcept; ---- [.small]#xref:CountingSemaphoreGrant/2constructor-02.adoc[_» more..._]# == Parameters [cols="1,4"] |=== | Name| Description | *other* | The grant to move from; left empty afterwards. | *sema* | The semaphore to acquire a slot from. | *fTry* | If true, try to acquire without blocking; otherwise block until acquired. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#