12#ifndef __cxz_reg_cc_h__
13#define __cxz_reg_cc_h__
20 template <
typename T,
class EPosT, SizeT...
Is>
21 inline decltype(
auto)
vregi(
const T*
d,
const EPosT& pos, std::index_sequence<Is...>
is)
24 static_assert(N ==
sizeof...(Is),
"got inconsistent index sequence");
28 template <
typename T,
class EPosT>
37 return vregi(
d, pos, std::make_index_sequence<N>{});
41 template <
typename T,
class EPosT>
51 return vregi(
d, pos, std::make_index_sequence<N>{});
55 template <SizeT I,
typename T>
60 "consecutive index out of range");
68 template <SizeT I,
typename T>
73 "consecutive index out of range");
81 template <SizeT I,
class F,
typename...
Args>
87 template <SizeT I,
class F,
typename Dst,
typename...
Args>
94 template <
class F,
typename...
Args, SizeT...
Is>
96 std::index_sequence<Is...>
is)
99 constexpr SizeT N =
sizeof...(Is);
103 template <
class F,
typename Dst,
typename...
Args, SizeT...
Is>
105 std::index_sequence<Is...>
is)
111 template <SizeT N,
class F,
typename...
Args>
117 template <SizeT N,
class F,
typename Dst,
typename...
Args>
127 template <
typename T,
typename U, SizeT N>
128 constexpr decltype(
auto)
131 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x +
y; }, a,
b );
134 template <
typename T,
typename U, SizeT N>
135 constexpr decltype(
auto)
138 return consecFuncA<N>( [](
auto& x,
const auto&
y) {
return x +=
y; }, o, a );
141 template <
typename T,
typename X, SizeT N>
144 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x +
y; }, a,
b );
147 template <
typename T,
typename X, SizeT N>
150 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x +
y; }, a,
b );
153 template <
typename T,
typename X, SizeT N>
156 return consecFuncA<N>( [](
auto& x,
const auto&
y) {
return x +=
y; }, o, a );
163 template <
typename T,
typename U, SizeT N>
166 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x -
y; }, a,
b );
169 template <
typename T,
typename X, SizeT N>
172 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x -
y; }, a,
b );
175 template <
typename T,
typename X, SizeT N>
178 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x -
y; }, a,
b );
181 template <
typename T,
typename U, SizeT N>
184 return consecFuncA<N>( [](
auto& x,
const auto&
y) {
return x -=
y; }, o, a );
187 template <
typename T,
typename X, SizeT N>
190 return consecFuncA<N>( [](
auto& x,
const auto&
y) {
return x -=
y; }, o, a );
197 template <
typename T,
typename U, SizeT N>
200 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x *
y; }, a,
b );
203 template <
typename T,
typename X, SizeT N>
206 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x *
y; }, a,
b );
209 template <
typename T,
typename X, SizeT N>
212 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x *
y; }, a,
b );
215 template <
typename T,
typename U, SizeT N>
218 return consecFuncA<N>( [](
const auto& x,
const auto&
y) {
return x *=
y; }, o, a );
221 template <
typename T,
typename X, SizeT N>
224 return consecFuncA<N>( [](
const auto& x,
const auto&
y) {
return x *=
y; }, o, a );
231 template <
typename T,
typename U, SizeT N>
234 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x /
y; }, a,
b );
237 template <
typename T,
typename X, SizeT N>
240 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x /
y; }, a,
b );
243 template <
typename T,
typename X, SizeT N>
246 return consecFunc<N>( [](
const auto& x,
const auto&
y) {
return x /
y; }, a,
b );
249 template <
typename T,
typename U, SizeT N>
252 return consecFuncA<N>( [](
const auto& x,
const auto&
y) {
return x /=
y; }, o, a );
255 template <
typename T,
typename X, SizeT N>
258 return consecFuncA<N>( [](
const auto& x,
const auto&
y) {
return x /=
y; }, o, a );
constexpr decltype(auto) consecGet(const T &a)
constexpr decltype(auto) consecFuncI(const F &f, const Args &... args, std::index_sequence< Is... > is)
constexpr decltype(auto) consecApply(const F &f, const Args &... args)
decltype(auto) vregi(const T *d, const EPosT &pos, std::index_sequence< Is... > is)
Sptr< Range > rangeCast(const RangePtr r)
constexpr decltype(auto) consecFunc(const F &f, const Args &... args)
constexpr Dst & consecFuncAI(const F &f, Dst &dst, const Args &... args, std::index_sequence< Is... > is)
constexpr Dst & consecAssign(const F &f, Dst &dst, const Args &... args)
decltype(auto) vreg(const T *d, const EPosT &pos)
constexpr Dst & consecFuncA(const F &f, Dst &dst, const Args &... args)
Position types declarations.
Register type declaration.