Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
thorin::Vector< T, N, A > Class Template Reference

This is a thin wrapper for absl::InlinedVector<T, N, A> which in turn is a drop-in replacement for std::vector<T, A>. More...

#include <thorin/util/vector.h>

Inheritance diagram for thorin::Vector< T, N, A >:
[legend]

Public Types

using Base = absl::InlinedVector< T, N, A >
 

Public Member Functions

Constructors
template<class F >
requires (std::is_invocable_r_v<T, F, size_t>)
constexpr Vector (size_t size, F &&f)
 
template<std::ranges::forward_range R, class F >
requires (std::is_invocable_r_v<T, F, decltype(*std::ranges::begin(range))>)
constexpr Vector (const R &range, F &&f)
 
Span
Span< T > span ()
 
Span< const T > span () const
 
Span< const T > view () const
 

Detailed Description

template<class T, size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
class thorin::Vector< T, N, A >

This is a thin wrapper for absl::InlinedVector<T, N, A> which in turn is a drop-in replacement for std::vector<T, A>.

In addition, there are generator-like/lambda-based constructors and conversions to Span available.

Definition at line 16 of file vector.h.

Member Typedef Documentation

◆ Base

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
using thorin::Vector< T, N, A >::Base = absl::InlinedVector<T, N, A>

Definition at line 18 of file vector.h.

Constructor & Destructor Documentation

◆ Vector() [1/2]

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
template<class F >
requires (std::is_invocable_r_v<T, F, size_t>)
constexpr thorin::Vector< T, N, A >::Vector ( size_t  size,
F &&  f 
)
inlineexplicitconstexpr

Definition at line 24 of file vector.h.

◆ Vector() [2/2]

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
template<std::ranges::forward_range R, class F >
requires (std::is_invocable_r_v<T, F, decltype(*std::ranges::begin(range))>)
constexpr thorin::Vector< T, N, A >::Vector ( const R range,
F &&  f 
)
inlineexplicitconstexpr

Definition at line 29 of file vector.h.

Member Function Documentation

◆ span() [1/2]

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
Span< T > thorin::Vector< T, N, A >::span ( )
inline

Definition at line 39 of file vector.h.

◆ span() [2/2]

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
Span< const T > thorin::Vector< T, N, A >::span ( ) const
inline

Definition at line 40 of file vector.h.

◆ view()

template<class T , size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
Span< const T > thorin::Vector< T, N, A >::view ( ) const
inline

Definition at line 41 of file vector.h.


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