Speclib  0.1.2
The library for writing better CUDA libraries
sp::c::Vector< ValueType, Log2MaxSize > Class Template Referencefinal

Like std::vector, but for compile-time use. More...

#include <Vector.hpp>

Public Types

using iterator = Iterator< ValueType >
 
using const_iterator = Iterator< const ValueType >
 

Public Member Functions

constexpr Vector (std::initializer_list< ValueType > init)
 
constexpr bool operator== (const Vector &other) const
 
constexpr bool operator!= (const Vector &other) const
 
constexpr ValueType & operator[] (uint32_t i)
 
constexpr const ValueType & operator[] (uint32_t i) const
 
constexpr iterator begin ()
 
constexpr iterator end ()
 
constexpr const_iterator begin () const
 
constexpr const_iterator end () const
 
constexpr bool empty () const
 
constexpr uint32_t size () const
 
constexpr void push_back (const ValueType &value)
 
constexpr void resize (uint32_t newSize)
 
constexpr bool contains (const ValueType &value) const
 

Public Attributes

uint32_t Size = 0
 

Detailed Description

template<typename ValueType, int Log2MaxSize = 32>
class sp::c::Vector< ValueType, Log2MaxSize >

Like std::vector, but for compile-time use.

Note
Like all structures in the sp::c namespace, this cannot be used at runtime.
Template Parameters
ValueTypeThe value type. Must be default constexpr constructible and constexpr copyable or a fundamental data type.
Log2MaxSizeThe maximum size of the string expressed as a log base 2. The default is 31 (enough for about 2 billion characters). The maximum size of the string is 2^Log2MaxSize - 1. This template parameter is useful to limit the address space used by the container (e.g: to nest containers).