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

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

#include <List.hpp>

Public Types

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

Public Member Functions

constexpr List (const std::initializer_list< ValueType > &init)
 
constexpr Listoperator+= (const List &other)
 Append another list to the end of this one. More...
 
constexpr List operator+ (const List &other) const
 Append another list to the end of a copy of this one. More...
 
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 iterator erase (const_iterator it)
 
constexpr iterator insert (const_iterator before, const ValueType &value)
 
template<typename It >
constexpr iterator insert (const_iterator before, It first, It last)
 
constexpr iterator push_front (const ValueType &value)
 
constexpr iterator push_back (const ValueType &value)
 
constexpr iterator pop_front ()
 
constexpr iterator pop_back ()
 

Friends

template<typename ReferenceType >
class Iterator
 

Detailed Description

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

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

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

Member Function Documentation

◆ operator+()

template<typename ValueType , int Log2MaxSize = 32>
constexpr List sp::c::List< ValueType, Log2MaxSize >::operator+ ( const List< ValueType, Log2MaxSize > &  other) const
constexpr

Append another list to the end of a copy of this one.

◆ operator+=()

template<typename ValueType , int Log2MaxSize = 32>
constexpr List & sp::c::List< ValueType, Log2MaxSize >::operator+= ( const List< ValueType, Log2MaxSize > &  other)
constexpr

Append another list to the end of this one.