Go to the documentation of this file. 1 #ifndef EAGINE_VECT_FILL_HPP
9 #define EAGINE_VECT_FILL_HPP
13 namespace eagine::vect {
15 template <
typename T,
int N,
bool V>
17 static auto apply(T v) noexcept -> data_t<T, N, V> {
19 for(
int i = 0; i < N; ++i) {
28 template <
typename T,
bool V>
29 struct fill<T, 0, V> {
30 static constexpr
auto apply(T) noexcept {
31 return data_t<T, 0, V>{};
35 template <
typename T,
bool V>
36 struct fill<T, 1, V> {
37 static constexpr
auto apply(T v) noexcept {
38 return data_t<T, 1, V>{v};
42 template <
typename T,
bool V>
43 struct fill<T, 2, V> {
44 static constexpr
auto apply(T v) noexcept {
45 return data_t<T, 2, V>{v, v};
49 template <
typename T,
bool V>
50 struct fill<T, 3, V> {
51 static constexpr
auto apply(T v) noexcept {
52 return data_t<T, 3, V>{v, v, v};
56 template <
typename T,
bool V>
57 struct fill<T, 4, V> {
58 static constexpr
auto apply(T v) noexcept {
59 return data_t<T, 4, V>{v, v, v, v};
63 template <
typename T,
bool V>
64 struct fill<T, 8, V> {
65 static constexpr
auto apply(T v) noexcept {
66 return data_t<T, 8, V>{v, v, v, v, v, v, v, v};
74 #endif // EAGINE_VECT_FILL_HPP
static auto fill(basic_span< T, P, S > spn, const V &v) -> basic_span< T, P, S >
Fills a span with copies of the specified value.
Definition: span_algo.hpp:536