14 template<
typename T,
size_t N, std::invocable<const T&> UnaryOperation>
18 for (
size_t i = 0;
i <
N; ++
i) {
19 rv[
i] = std::invoke(
op, x[
i]);
25 template<
typename T,
size_t N, std::invocable<const T&, const T&> BinaryOperation>
28 Vector<
decltype(std::invoke(
op, x[0], y[0])),
N>
rv{};
29 for (
size_t i = 0;
i <
N; ++
i) {
30 rv[
i] = std::invoke(
op, x[
i], y[
i]);
36 template<
typename T,
size_t N, std::invocable<const T&, const T&, const T&> TernaryOperation>
38 ->
Vector<
decltype(std::invoke(
op, x[0], y[0], z[0])),
N>
40 Vector<
decltype(std::invoke(
op, x[0], y[0], z[0])),
N>
rv{};
41 for (
size_t i = 0;
i <
N; ++
i) {
42 rv[
i] = std::invoke(
op, x[
i], y[
i], z[
i]);
51 return std::ranges::all_of(
v, std::identity{});
58 return std::ranges::any_of(
v, std::identity{});
65 return std::ranges::none_of(
v, std::identity{});
Definition custom_decoration_generator.h:5
constexpr auto map(const Rgba< T > &x, UnaryOperation op) -> Rgba< decltype(std::invoke(op, x[0]))>
Definition rgba.h:208
constexpr U to(T &&value)
Definition conversion.h:56
constexpr bool all_of(const Vector< bool, N > &v)
Definition functors.h:49
constexpr bool any_of(const Vector< bool, N > &v)
Definition functors.h:56
constexpr bool none_of(const Vector< bool, N > &v)
Definition functors.h:63