MimIR 0.1
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
mim::Vector< T, N, A > Class Template Reference

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

#include <mim/util/vector.h>

Inheritance diagram for mim::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) noexcept(std::is_nothrow_invocable_r_v< T, F, size_t > &&std::is_nothrow_assignable_v< T &, T >)
 
template<std::ranges::forward_range R, class F>
requires (std::is_invocable_r_v<T, F, decltype(*std::ranges::begin(range))> && !std::is_same_v<std::decay_t<R>, Vector>)
constexpr Vector (R &&range, F &&f) noexcept(std::is_nothrow_invocable_r_v< T, F, decltype(*std::ranges::begin(range))> &&std::is_nothrow_assignable_v< T &, T >)
 
Span
constexpr auto span () noexcept
 
constexpr auto span () const noexcept
 
constexpr auto view () const noexcept
 

Friends

void swap (Vector &v1, Vector &v2) noexcept(noexcept(v1.swap(v2)))
 

Detailed Description

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

This is a thin wrapper for absl::InlinedVector<T, N, A> which 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 17 of file vector.h.

Member Typedef Documentation

◆ Base

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

Definition at line 19 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>)
mim::Vector< T, N, A >::Vector ( size_t size,
F && f )
inlineexplicitconstexprnoexcept

Definition at line 25 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))> && !std::is_same_v<std::decay_t<R>, Vector>)
mim::Vector< T, N, A >::Vector ( R && range,
F && f )
inlineexplicitconstexprnoexcept

Definition at line 33 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>>
auto mim::Vector< T, N, A >::span ( ) const
inlineconstexprnoexcept

Definition at line 47 of file vector.h.

◆ span() [2/2]

template<class T, size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
auto mim::Vector< T, N, A >::span ( )
inlineconstexprnoexcept

Definition at line 46 of file vector.h.

Referenced by mim::Vector< const Def * >::view().

◆ view()

template<class T, size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
auto mim::Vector< T, N, A >::view ( ) const
inlineconstexprnoexcept

Definition at line 48 of file vector.h.

Friends And Related Symbol Documentation

◆ swap

template<class T, size_t N = Default_Inlined_Size<T>, class A = std::allocator<T>>
void swap ( Vector< T, N, A > & v1,
Vector< T, N, A > & v2 )
friend

Definition at line 51 of file vector.h.


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