count

count#

stdgpu: stdgpu::unordered_set::count
stdgpu Latest
Efficient STL-like Data Structures on the GPU

◆ count() [2/2]

template<typename Key , typename Hash = hash<Key>, typename KeyEqual = equal_to<Key>, typename Allocator = safe_device_allocator<Key>>
template<typename KeyLike , STDGPU_DETAIL_OVERLOAD_IF(detail::is_transparent_v< Hash > &&detail::is_transparent_v< KeyEqual >) >
STDGPU_DEVICE_ONLY index_type stdgpu::unordered_set< Key, Hash, KeyEqual, Allocator >::count ( const KeyLike &  key) const

Returns the number of elements with the given key-like value in the container.

Parameters
[in]keyThe key-like value
Returns
The number of elements with the given key-like value, i.e. 1 or 0