operator[]

operator[]#

stdgpu: stdgpu::mutex_array::operator[]
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ operator[]() [2/2]

template<typename Block = mutex_default_type, typename Allocator = safe_device_allocator<Block>>
STDGPU_DEVICE_ONLY const reference stdgpu::mutex_array< Block, Allocator >::operator[] ( const index_t  n) const

Returns a reference to the n-th mutex.

Parameters
[in]nThe position of the requested mutex
Returns
The n-th mutex
Precondition
0 <= n < size()