dispenso 1.4.1
A library for task parallelism
Loading...
Searching...
No Matches
dispenso::DefaultConcurrentVectorSizeTraits< T > Struct Template Reference

#include <concurrent_vector.h>

Static Public Attributes

static constexpr size_t kMaxVectorSize
 The maximum possible size for the vector.
 

Detailed Description

template<typename T>
struct dispenso::DefaultConcurrentVectorSizeTraits< T >

The default ConcurrentVector traits type for defining capacities and max capacities. Both members are required should one wish to supply a custom set of traits.

Definition at line 91 of file concurrent_vector.h.

Member Data Documentation

◆ kMaxVectorSize

template<typename T >
size_t dispenso::DefaultConcurrentVectorSizeTraits< T >::kMaxVectorSize
staticconstexpr
Initial value:
=
(size_t{1} << (sizeof(size_t) * CHAR_BIT > 47 ? 47 : sizeof(size_t) * CHAR_BIT - 1)) /
sizeof(T)

The maximum possible size for the vector.

The reason this exists is because if someone doesn't require vectors of length in e.g. petabytes, the class can use less space. Additionally, some minor optimizations may be possible if the max size is less than 32-bits.

Definition at line 105 of file concurrent_vector.h.


The documentation for this struct was generated from the following file: