10#ifndef _CGP_ARRAY_TUPLE_VECTOR_OPERATIONS_HPP
11#define _CGP_ARRAY_TUPLE_VECTOR_OPERATIONS_HPP
24 template< cgt::tuple_c Left, cgt::tuple_c Right>
25 requires requires (Left l, Right r) { l + r; }
26 auto operator+(std::vector<Left>
const& L, std::vector<Right>
const& R)
28 assert(L.size() == R.size());
30 using common_t =
decltype(Left{} + Right{});
31 using vctr_t = std::vector<common_t>;
35 for(std::size_t i{}; i < L.size(); ++i)
41 template< cgt::tuple_c Left, cgt::tuple_c Right>
42 requires requires (Left l, Right r) { l + r; }
43 auto operator-(std::vector<Left>
const& L, std::vector<Right>
const& R)
45 assert(L.size() == R.size());
47 using common_t =
decltype(Left{} + Right{});
48 using vctr_t = std::vector<common_t>;
52 for(std::size_t i{}; i < L.size(); ++i)
58 template< cgt::tuple_c Left, cgt::tuple_c Right>
59 requires requires (Left l, Right r) { l + r; }
60 auto operator*(std::vector<Left>
const& L, std::vector<Right>
const& R)
62 assert(L.size() == R.size());
64 using common_t =
decltype(Left{} + Right{});
65 using vctr_t = std::vector<common_t>;
69 for(std::size_t i{}; i < L.size(); ++i)
75 template< cgt::tuple_c Left, cgt::tuple_c Right>
76 requires requires (Left l, Right r) { l + r; }
77 auto operator/(std::vector<Left>
const& L, std::vector<Right>
const& R)
79 assert(L.size() == R.size());
81 using common_t =
decltype(Left{} + Right{});
82 using vctr_t = std::vector<common_t>;
86 for(std::size_t i{}; i < L.size(); ++i)
92 template< cgt::vector_c Left, cgt::vector_c Right, std::
size_t N>
93 requires requires (Left l, Right r) { l + r; }
94 auto operator+(std::array<Left, N>
const& L, std::array<Right, N>
const& R)
96 using vctr_t =
decltype(Left{} + Right{});
97 using array_t = std::array<vctr_t, N>;
101 for(std::size_t i{}; i < L.size(); ++i)
107 template< cgt::vector_c Left, cgt::vector_c Right, std::
size_t N>
108 requires requires (Left l, Right r) { l + r; }
109 auto operator-(std::array<Left, N>
const& L, std::array<Right, N>
const& R)
111 using vctr_t =
decltype(Left{} - Right{});
112 using array_t = std::array<vctr_t, N>;
116 for(std::size_t i{}; i < L.size(); ++i)
123 template< cgt::vector_c Left, cgt::vector_c Right, std::
size_t N>
124 requires requires (Left l, Right r) { l + r; }
125 auto operator*(std::array<Left, N>
const& L, std::array<Right, N>
const& R)
127 using vctr_t =
decltype(Left{} * Right{});
128 using array_t = std::array<vctr_t, N>;
132 for(std::size_t i{}; i < L.size(); ++i)
138 template< cgt::vector_c Left, cgt::vector_c Right, std::
size_t N>
139 requires requires (Left l, Right r) { l + r; }
140 auto operator/(std::array<Left, N>
const& L, std::array<Right, N>
const& R)
142 using vctr_t =
decltype(Left{} / Right{});
143 using array_t = std::array<vctr_t, N>;
147 for(std::size_t i{}; i < L.size(); ++i)
155 template<
typename S,
typename T>
162 template<
typename S,
typename T>
165 std::declval<std::remove_cvref_t<S>>(), std::declval<std::remove_cvref_t<T>>()));
std::common_type_t< S, T > common_t
auto operator-(const std::tuple< ArgTypes1... > &tuple_a, const std::tuple< ArgTypes2... > &tuple_b)
auto operator+(const std::tuple< ArgTypes1... > &tuple_a, const std::tuple< ArgTypes2... > &tuple_b)
auto operator/(const std::tuple< ArgTypes1... > &tuple_a, const std::tuple< ArgTypes2... > &tuple_b)
auto operator*(const std::tuple< ArgTypes1... > &tuple_a, const std::tuple< ArgTypes2... > &tuple_b)
auto fn_common_container_type(S s, T t)
decltype(hidden::fn_common_container_type(std::declval< std::remove_cvref_t< S > >(), std::declval< std::remove_cvref_t< T > >())) common_container_t