|
native 0.0.1
Vectors, masks and wide register packs for C++26
|
Own N values of T, including an empty pack when N == 0. registers is the underlying array. Tuple access and structured bindings refer to the actual elements. Value initialization follows T's rules; no general floating-point or zero-initialization policy is added here. More...
#include <wide.h>
Public Member Functions | |
| constexpr | wide ()=default |
| Default-initialize the underlying array. Use wide{} for value initialization. | |
|
template<std::size_t I> requires (I < N) | |
| constexpr T & | get () &noexcept |
| Access element I, preserving constness and the value category of the pack. | |
|
template<std::size_t I> requires (I < N) | |
| constexpr T const & | get () const &noexcept |
| Access element I, preserving constness and the value category of the pack. | |
|
template<std::size_t I> requires (I < N) | |
| constexpr T && | get () &&noexcept |
| Access element I, preserving constness and the value category of the pack. | |
|
template<std::size_t I> requires (I < N) | |
| constexpr T const && | get () const &&noexcept |
| Access element I, preserving constness and the value category of the pack. | |
| constexpr | wide () noexcept(std::is_nothrow_default_constructible_v< std::array< T, N > >) |
| Retain opted-in array initialization in the element's target scope. | |
| constexpr | wide (std::array< T, N > values) noexcept(std::is_nothrow_move_constructible_v< std::array< T, N > >) |
| Take an array of exactly the pack extent. | |
|
template<class... U> requires (detail::wide_target<T,U...> == NATIVE_WIDE_INDEX) && (sizeof...(U) == N && N != 0) && (std::constructible_from<T,U && > && ...) && (N != 1 || ((!detail::wide_traits<std::remove_cvref_t<U>>::value && !std::same_as<std::remove_cvref_t<U>, std::array<T,N>>) && ...)) | |
| constexpr | wide (U &&... values) noexcept((std::is_nothrow_constructible_v< T, U && > &&...)) |
| Construct one element from each argument, preserving argument order. | |
|
template<class U> requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (N != 1) && (!detail::wide_traits<std::remove_cvref_t<U>>::value) && (!std::same_as<std::remove_cvref_t<U>,std::array<T, N>>) && std::constructible_from<T,U const &> && (N == 0 || std::copy_constructible<T>) | |
| constexpr | wide (U const &value) noexcept(std::is_nothrow_constructible_v< T, U const & > &&(N==0||std::is_nothrow_copy_constructible_v< T >)) |
| Convert one value to T, then copy it across the pack. | |
|
template<class U> requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (!std::same_as<T,U>) && std::constructible_from<T,U const &> | |
| constexpr | wide (wide< U, N > const &source) noexcept(N==0||std::is_nothrow_constructible_v< T, U const & >) |
| Convert each element of a same-size pack; explicitness follows the element conversion. | |
|
template<class U> requires (detail::wide_target<T,U> == NATIVE_WIDE_INDEX) && (!std::same_as<T,U>) && std::constructible_from<T,U &&> | |
| constexpr | wide (wide< U, N > &&source) noexcept(N==0||std::is_nothrow_constructible_v< T, U && >) |
| Convert each element of a same-size pack; explicitness follows the element conversion. | |
|
template<class F> requires (detail::wide_target<T> == NATIVE_WIDE_INDEX) | |
| constexpr decltype(auto) | apply (F &&f) noexcept(noexcept(std::apply(std::forward< F >(f), registers))) |
| Invoke f with all elements as arguments; the empty pack calls f(). | |
|
template<class F> requires (detail::wide_target<T> == NATIVE_WIDE_INDEX) | |
| constexpr decltype(auto) | apply (F &&f) const noexcept(noexcept(std::apply(std::forward< F >(f), registers))) |
| Invoke f with all elements as arguments; the empty pack calls f(). | |
Static Public Member Functions | |
| static constexpr wide | broadcast (T const &value) noexcept(N==0||std::is_nothrow_copy_constructible_v< T >) |
| Copy value to every element; an empty pack makes no copies. | |
Own N values of T, including an empty pack when N == 0. registers is the underlying array. Tuple access and structured bindings refer to the actual elements. Value initialization follows T's rules; no general floating-point or zero-initialization policy is added here.