Skip to content

Class univector

class univector<T, Size> base

template <typename T, size_t Size>
struct alignas(platform<>::maximum_vector_alignment) univector
    : std::array<T, Size>,
      univector_base<T, univector<T, Size>, is_vec_element<T>> { … }

Class that represent data in KFR. Many KFR functions can take this class as an argument. Can inherit from std::vector, std::array or keep only reference to data and its size.

univector<float> is inherited from std::vector<float> univector<float, 10> is inherited from std::array<float, 10> univector<float, 0> contains only reference to dataTo convert a plain pointer to univector, call make_univector:

double* buffer;
 size_t size;
 univector<double, 0> v = make_univector(buffer, size);
 // or pass result vector directly to a function:
 some_function(make_univector(buffer, size));

typedef size_type

using size_type = size_t

Fully qualified name: kfr::univector<T, Size>::size_type

constructor univector<T, Size>(univector<T, Size> &)

univector(univector& v)

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(univector<T, Size> &)

constructor univector<T, Size>(const univector<T, Size> &)

univector(const univector& v)   = default

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(const univector<T, Size> &)

constructor univector<T, Size>(univector<T, Size> &&)

univector(univector&&) noexcept = default

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(univector<T, Size> &&)

function univector<T, Size>(Input &&)

template <expression_argument Input>
univector(Input&& input)

Constructs the vector and initializes it from an input expression.

Template parameters
Input Type of the input expression.
Parameters
input Expression to assign.

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(Input &&)

function univector<T, Size>(const T &, const Args &...)

template <typename... Args>
constexpr univector(const T& x, const Args&... args) noexcept
    : std::array<T, Size> { … }

Constructs the vector from a brace-enclosed list of values.

Parameters
x First element value.
args Remaining element values.

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(const T &, const Args &...)

constructor univector<T, Size>()

constexpr univector() noexcept(noexcept(std::array<T, Size>())) = default

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>()

constructor univector<T, Size>(size_t, const T &)

constexpr univector(size_t, const T& value) { … }

Constructs the vector with Size copies of value.

Parameters
value Value to fill the vector with.

Fully qualified name: kfr::univector<T, Size>::univector<T, Size>(size_t, const T &)

variable size_known

constexpr static bool size_known    = true

True: the size is known at compile time.

Fully qualified name: kfr::univector<T, Size>::size_known

variable static_size

constexpr static size_t static_size = Size

Compile-time size of the vector.

Fully qualified name: kfr::univector<T, Size>::static_size

variable is_array

constexpr static bool is_array      = true

True: backed by std::array.

Fully qualified name: kfr::univector<T, Size>::is_array

variable is_array_ref

constexpr static bool is_array_ref  = false

False: owns its data.

Fully qualified name: kfr::univector<T, Size>::is_array_ref

variable is_vector

constexpr static bool is_vector     = false

False: not dynamically sized.

Fully qualified name: kfr::univector<T, Size>::is_vector

variable is_aligned

constexpr static bool is_aligned    = true

True: aligned to the maximum vector alignment.

Fully qualified name: kfr::univector<T, Size>::is_aligned

typedef value_type

using value_type                    = T

Fully qualified name: kfr::univector<T, Size>::value_type

function get(size_t, value_type)

value_type get(size_t index, value_type fallback_value) const noexcept

Returns the element at index, or fallback_value if index is out of range.

Parameters
index Index of the element to access.
fallback_value Value returned when index is out of range.
Returns
The element at index, or fallback_value.

Fully qualified name: kfr::univector<T, Size>::get(size_t, value_type)

function resize(size_t)

void resize(size_t) noexcept

No-op for API compatibility with dynamically sized vectors.

Fully qualified name: kfr::univector<T, Size>::resize(size_t)

Fully qualified name: kfr::univector<T, Size>

Class univector

class univector<T, tag_array_ref> base

template <typename T>
struct univector<T, tag_array_ref> : array_ref<T>,
                                     univector_base<T, univector<T, tag_array_ref>, is_vec_element<T>> { … }

Non-owning univector specialization that holds a reference to external data.

Template parameters
T Element type. May be const-qualified to expose a read-only view.

typedef size_type

using size_type = size_t

Fully qualified name: kfr::univector<T, tag_array_ref>::size_type

constructor univector<T, tag_array_ref>(univector<T, tag_array_ref> &)

univector(univector& v)

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(univector<T, tag_array_ref> &)

constructor univector<T, tag_array_ref>(const univector<T, tag_array_ref> &)

univector(const univector& v)   = default

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(const univector<T, tag_array_ref> &)

constructor univector<T, tag_array_ref>(univector<T, tag_array_ref> &&)

univector(univector&&) noexcept = default

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(univector<T, tag_array_ref> &&)

constructor univector<T, tag_array_ref>(const array_ref<T> &)

constexpr univector(const array_ref<T>& other) : array_ref<T>(other) { … }

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(const array_ref<T> &)

constructor univector<T, tag_array_ref>(array_ref<T> &&)

constexpr univector(array_ref<T>&& other) : array_ref<T>(std::move(other)) { … }

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(array_ref<T> &&)

function univector<T, tag_array_ref>(const univector<T, Tag> &)

template <univector_tag Tag>
constexpr univector(const univector<T, Tag>& other) : array_ref<T>(other.data(), other.size()) { … }

Constructs a reference from a const univector of any storage tag.

Template parameters
Tag Storage tag of the source vector.
Parameters
other Source vector to reference.

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(const univector<T, Tag> &)

function univector<T, tag_array_ref>(univector<T, Tag> &)

template <univector_tag Tag>
constexpr univector(univector<T, Tag>& other) : array_ref<T>(other.data(), other.size()) { … }

Constructs a reference from a mutable univector of any storage tag.

Template parameters
Tag Storage tag of the source vector.
Parameters
other Source vector to reference.

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(univector<T, Tag> &)

function univector<T, tag_array_ref>(const univector<U, Tag> &)

template <typename U, univector_tag Tag>
    requires(std::is_same_v<std::remove_const_t<T>, U> && std::is_const_v<T>)
constexpr univector(const univector<U, Tag>& other) : array_ref<T>(other.data(), other.size()) { … }

Constructs a const reference from a const univector of a different element type. Only participates in overload resolution when T is const-qualified and the underlying element types match after removing const.

Template parameters
U Element type of the source vector.
Tag Storage tag of the source vector.
Parameters
other Source vector to reference.

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(const univector<U, Tag> &)

function univector<T, tag_array_ref>(univector<U, Tag> &)

template <typename U, univector_tag Tag>
    requires(std::is_same_v<std::remove_const_t<T>, U> && std::is_const_v<T>)
constexpr univector(univector<U, Tag>& other) : array_ref<T>(other.data(), other.size()) { … }

Constructs a const reference from a mutable univector of a different element type.

Template parameters
U Element type of the source vector.
Tag Storage tag of the source vector.
Parameters
other Source vector to reference.

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(univector<U, Tag> &)

function univector<T, tag_array_ref>(univector<U, Tag> &&)

template <typename U, univector_tag Tag>
    requires(std::is_same_v<std::remove_const_t<T>, U> && std::is_const_v<T>)
constexpr univector(univector<U, Tag>&& other) : array_ref<T>(other.data(), other.size()) { … }

Constructs a const reference by taking a reference to the data of a temporary univector.

Template parameters
U Element type of the source vector.
Tag Storage tag of the source vector.
Parameters
other Source vector to reference.

Fully qualified name: kfr::univector<T, tag_array_ref>::univector<T, tag_array_ref>(univector<U, Tag> &&)

function resize(size_t)

void resize(size_t) noexcept

No-op for API compatibility with dynamically sized vectors.

Fully qualified name: kfr::univector<T, tag_array_ref>::resize(size_t)

variable size_known

constexpr static bool size_known   = false

False: the size is not known at compile time.

Fully qualified name: kfr::univector<T, tag_array_ref>::size_known

variable is_array

constexpr static bool is_array     = false

False: not backed by std::array.

Fully qualified name: kfr::univector<T, tag_array_ref>::is_array

variable is_array_ref

constexpr static bool is_array_ref = true

True: holds a reference to external data.

Fully qualified name: kfr::univector<T, tag_array_ref>::is_array_ref

variable is_vector

constexpr static bool is_vector    = false

False: not dynamically sized.

Fully qualified name: kfr::univector<T, tag_array_ref>::is_vector

variable is_aligned

constexpr static bool is_aligned = false

False: alignment of the referenced data is unknown.

Fully qualified name: kfr::univector<T, tag_array_ref>::is_aligned

typedef value_type

using value_type                 = std::remove_const_t<T>

Fully qualified name: kfr::univector<T, tag_array_ref>::value_type

function get(size_t, value_type)

value_type get(size_t index, value_type fallback_value) const noexcept

Returns the element at index, or fallback_value if index is out of range.

Parameters
index Index of the element to access.
fallback_value Value returned when index is out of range.
Returns
The element at index, or fallback_value.

Fully qualified name: kfr::univector<T, tag_array_ref>::get(size_t, value_type)

function ref()

univector<T, tag_array_ref>& ref() &&

Returns *this as a reference. Intended for use on rvalues to forward the contained reference without copying.

Fully qualified name: kfr::univector<T, tag_array_ref>::ref()

Fully qualified name: kfr::univector<T, tag_array_ref>

Class univector

class univector<T, tag_dynamic_vector> base

template <typename T>
struct univector<T, tag_dynamic_vector>
    : std::vector<T, data_allocator<T>>,
      univector_base<T, univector<T, tag_dynamic_vector>, is_vec_element<T>> { … }

Dynamically sized, owning univector backed by std::vector using KFR's data_allocator . Memory is aligned to the maximum vector alignment.

Template parameters
T Element type. Must not be const-qualified.

typedef size_type

using size_type = size_t

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::size_type

constructor univector<T, tag_dynamic_vector>(univector<T, tag_dynamic_vector> &)

univector(univector& v)

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(univector<T, tag_dynamic_vector> &)

constructor univector<T, tag_dynamic_vector>(const univector<T, tag_dynamic_vector> &)

univector(const univector& v)   = default

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(const univector<T, tag_dynamic_vector> &)

constructor univector<T, tag_dynamic_vector>(univector<T, tag_dynamic_vector> &&)

univector(univector&&) noexcept = default

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(univector<T, tag_dynamic_vector> &&)

function univector<T, tag_dynamic_vector>(Input &&)

template <expression_argument Input>
univector(Input&& input)

Constructs the vector from an input expression, resizing to the expression's size. The expression must be finite and have at most one dimension.

Template parameters
Input Type of the input expression.
Parameters
input Expression to assign.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(Input &&)

constructor univector<T, tag_dynamic_vector>()

constexpr univector() noexcept(noexcept(std::vector<T, data_allocator<T>>())) = default

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>()

constructor univector<T, tag_dynamic_vector>(const std::vector<T, data_allocator<T>> &)

constexpr univector(const std::vector<T, data_allocator<T>>& other)
    : std::vector<T, data_allocator<T>>(other) { … }

Copy-constructs from a std::vector using the same allocator.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(const std::vector<T, data_allocator<T>> &)

constructor univector<T, tag_dynamic_vector>(std::vector<T, data_allocator<T>> &&)

constexpr univector(std::vector<T, data_allocator<T>>&& other)
    : std::vector<T, data_allocator<T>>(std::move(other)) { … }

Move-constructs from a std::vector using the same allocator.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(std::vector<T, data_allocator<T>> &&)

constructor univector<T, tag_dynamic_vector>(const array_ref<T> &)

constexpr univector(const array_ref<T>& other)
    : std::vector<T, data_allocator<T>>(other.begin(), other.end()) { … }

Constructs from a mutable array_ref by copying its elements.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(const array_ref<T> &)

constructor univector<T, tag_dynamic_vector>(const array_ref<const T> &)

constexpr univector(const array_ref<const T>& other)
    : std::vector<T, data_allocator<T>>(other.begin(), other.end()) { … }

Constructs from a const array_ref by copying its elements.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(const array_ref<const T> &)

function univector<T, tag_dynamic_vector>(const std::vector<T, Allocator> &)

template <typename Allocator>
constexpr univector(const std::vector<T, Allocator>&)

Deleted overload to prevent construction from a std::vector with a foreign allocator.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(const std::vector<T, Allocator> &)

function univector<T, tag_dynamic_vector>(std::vector<T, Allocator> &&)

template <typename Allocator>
constexpr univector(std::vector<T, Allocator>&&)

Deleted overload to prevent construction from a std::vector with a foreign allocator.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::univector<T, tag_dynamic_vector>(std::vector<T, Allocator> &&)

variable size_known

constexpr static bool size_known   = false

False: the size is not known at compile time.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::size_known

variable is_array

constexpr static bool is_array     = false

False: not backed by std::array.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::is_array

variable is_array_ref

constexpr static bool is_array_ref = false

False: owns its data.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::is_array_ref

variable is_vector

constexpr static bool is_vector    = true

True: dynamically sized.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::is_vector

variable is_aligned

constexpr static bool is_aligned   = true

True: aligned to the maximum vector alignment.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::is_aligned

typedef value_type

using value_type                   = T

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::value_type

function get(size_t, value_type)

value_type get(size_t index, value_type fallback_value) const noexcept

Returns the element at index, or fallback_value if index is out of range.

Parameters
index Index of the element to access.
fallback_value Value returned when index is out of range.
Returns
The element at index, or fallback_value.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::get(size_t, value_type)

function operator=(const univector<T, tag_dynamic_vector> &)

univector& operator=(const univector&) = default

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::operator=(const univector<T, tag_dynamic_vector> &)

function operator=(univector<T, tag_dynamic_vector> &&)

univector& operator=(univector&&)      = default

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::operator=(univector<T, tag_dynamic_vector> &&)

function operator=(univector<T, tag_dynamic_vector> &)

Copy assignment from a mutable univector (forwards to the const overload).

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::operator=(univector<T, tag_dynamic_vector> &)

function operator=(Input &&)

template <expression_argument Input>
KFR_MEM_INTRINSIC univector& operator=(Input&& input)

Assigns an expression to the vector, resizing it when the expression has a finite size.

Template parameters
Input Type of the input expression.
Parameters
input Expression to assign.
Returns
Reference to *this.

Fully qualified name: kfr::univector<T, tag_dynamic_vector>::operator=(Input &&)

Fully qualified name: kfr::univector<T, tag_dynamic_vector>

This file was generated by cxxdox, a C++ documentation generator based on MkDocs Material and libclang.