File indexing completed on 2025-09-17 08:54:12
0001
0002
0003
0004
0005
0006
0007 #pragma once
0008
0009 #include <utility>
0010
0011 #include <covfie/core/utility/backend_traits.hpp>
0012
0013 namespace covfie {
0014 template <typename... Ts>
0015 class parameter_pack
0016 {
0017 };
0018
0019 template <>
0020 class parameter_pack<>
0021 {
0022 public:
0023 parameter_pack()
0024 {
0025 }
0026 };
0027
0028 template <typename T, typename... Ts>
0029 class parameter_pack<T, Ts...>
0030 {
0031 public:
0032 parameter_pack(T && _x, Ts &&... _xs)
0033 : x(std::forward<T>(_x))
0034 , xs(std::forward<Ts>(_xs)...)
0035 {
0036 }
0037
0038 T x;
0039 parameter_pack<Ts...> xs;
0040 };
0041
0042 template <typename... Ts>
0043 parameter_pack<Ts...> make_parameter_pack(Ts &&... args)
0044 {
0045 return parameter_pack<Ts...>(std::forward<Ts>(args)...);
0046 }
0047
0048
0049
0050
0051 template <typename F>
0052 requires(
0053 utility::backend_depth<typename F::backend_t>::value == 1
0054 ) auto make_parameter_pack_for(typename utility::
0055 nth_backend<typename F::backend_t, 0>::type::
0056 configuration_t && a0)
0057 {
0058 return make_parameter_pack(
0059 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0060 type::configuration_t>(a0)
0061 );
0062 }
0063
0064 template <typename F>
0065 requires(utility::backend_depth<typename F::backend_t>::value == 2) auto make_parameter_pack_for(
0066 typename utility::nth_backend<typename F::backend_t, 0>::type::
0067 configuration_t && a0,
0068 typename utility::nth_backend<typename F::backend_t, 1>::type::
0069 configuration_t && a1
0070 )
0071 {
0072 return make_parameter_pack(
0073 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0074 type::configuration_t>(a0),
0075 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0076 type::configuration_t>(a1)
0077 );
0078 }
0079
0080 template <typename F>
0081 requires(utility::backend_depth<typename F::backend_t>::value == 3) auto make_parameter_pack_for(
0082 typename utility::nth_backend<typename F::backend_t, 0>::type::
0083 configuration_t && a0,
0084 typename utility::nth_backend<typename F::backend_t, 1>::type::
0085 configuration_t && a1,
0086 typename utility::nth_backend<typename F::backend_t, 2>::type::
0087 configuration_t && a2
0088 )
0089 {
0090 return make_parameter_pack(
0091 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0092 type::configuration_t>(a0),
0093 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0094 type::configuration_t>(a1),
0095 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0096 type::configuration_t>(a2)
0097 );
0098 }
0099
0100 template <typename F>
0101 requires(utility::backend_depth<typename F::backend_t>::value == 4) auto make_parameter_pack_for(
0102 typename utility::nth_backend<typename F::backend_t, 0>::type::
0103 configuration_t && a0,
0104 typename utility::nth_backend<typename F::backend_t, 1>::type::
0105 configuration_t && a1,
0106 typename utility::nth_backend<typename F::backend_t, 2>::type::
0107 configuration_t && a2,
0108 typename utility::nth_backend<typename F::backend_t, 3>::type::
0109 configuration_t && a3
0110 )
0111 {
0112 return make_parameter_pack(
0113 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0114 type::configuration_t>(a0),
0115 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0116 type::configuration_t>(a1),
0117 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0118 type::configuration_t>(a2),
0119 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0120 type::configuration_t>(a3)
0121 );
0122 }
0123
0124 template <typename F>
0125 requires(utility::backend_depth<typename F::backend_t>::value == 5) auto make_parameter_pack_for(
0126 typename utility::nth_backend<typename F::backend_t, 0>::type::
0127 configuration_t && a0,
0128 typename utility::nth_backend<typename F::backend_t, 1>::type::
0129 configuration_t && a1,
0130 typename utility::nth_backend<typename F::backend_t, 2>::type::
0131 configuration_t && a2,
0132 typename utility::nth_backend<typename F::backend_t, 3>::type::
0133 configuration_t && a3,
0134 typename utility::nth_backend<typename F::backend_t, 4>::type::
0135 configuration_t && a4
0136 )
0137 {
0138 return make_parameter_pack(
0139 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0140 type::configuration_t>(a0),
0141 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0142 type::configuration_t>(a1),
0143 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0144 type::configuration_t>(a2),
0145 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0146 type::configuration_t>(a3),
0147 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0148 type::configuration_t>(a4)
0149 );
0150 }
0151
0152 template <typename F>
0153 requires(utility::backend_depth<typename F::backend_t>::value == 6) auto make_parameter_pack_for(
0154 typename utility::nth_backend<typename F::backend_t, 0>::type::
0155 configuration_t && a0,
0156 typename utility::nth_backend<typename F::backend_t, 1>::type::
0157 configuration_t && a1,
0158 typename utility::nth_backend<typename F::backend_t, 2>::type::
0159 configuration_t && a2,
0160 typename utility::nth_backend<typename F::backend_t, 3>::type::
0161 configuration_t && a3,
0162 typename utility::nth_backend<typename F::backend_t, 4>::type::
0163 configuration_t && a4,
0164 typename utility::nth_backend<typename F::backend_t, 5>::type::
0165 configuration_t && a5
0166 )
0167 {
0168 return make_parameter_pack(
0169 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0170 type::configuration_t>(a0),
0171 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0172 type::configuration_t>(a1),
0173 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0174 type::configuration_t>(a2),
0175 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0176 type::configuration_t>(a3),
0177 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0178 type::configuration_t>(a4),
0179 std::forward<typename utility::nth_backend<typename F::backend_t, 5>::
0180 type::configuration_t>(a5)
0181 );
0182 }
0183
0184 template <typename F>
0185 requires(utility::backend_depth<typename F::backend_t>::value == 7) auto make_parameter_pack_for(
0186 typename utility::nth_backend<typename F::backend_t, 0>::type::
0187 configuration_t && a0,
0188 typename utility::nth_backend<typename F::backend_t, 1>::type::
0189 configuration_t && a1,
0190 typename utility::nth_backend<typename F::backend_t, 2>::type::
0191 configuration_t && a2,
0192 typename utility::nth_backend<typename F::backend_t, 3>::type::
0193 configuration_t && a3,
0194 typename utility::nth_backend<typename F::backend_t, 4>::type::
0195 configuration_t && a4,
0196 typename utility::nth_backend<typename F::backend_t, 5>::type::
0197 configuration_t && a5,
0198 typename utility::nth_backend<typename F::backend_t, 6>::type::
0199 configuration_t && a6
0200 )
0201 {
0202 return make_parameter_pack(
0203 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0204 type::configuration_t>(a0),
0205 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0206 type::configuration_t>(a1),
0207 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0208 type::configuration_t>(a2),
0209 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0210 type::configuration_t>(a3),
0211 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0212 type::configuration_t>(a4),
0213 std::forward<typename utility::nth_backend<typename F::backend_t, 5>::
0214 type::configuration_t>(a5),
0215 std::forward<typename utility::nth_backend<typename F::backend_t, 6>::
0216 type::configuration_t>(a6)
0217 );
0218 }
0219
0220 template <typename F>
0221 requires(utility::backend_depth<typename F::backend_t>::value == 8) auto make_parameter_pack_for(
0222 typename utility::nth_backend<typename F::backend_t, 0>::type::
0223 configuration_t && a0,
0224 typename utility::nth_backend<typename F::backend_t, 1>::type::
0225 configuration_t && a1,
0226 typename utility::nth_backend<typename F::backend_t, 2>::type::
0227 configuration_t && a2,
0228 typename utility::nth_backend<typename F::backend_t, 3>::type::
0229 configuration_t && a3,
0230 typename utility::nth_backend<typename F::backend_t, 4>::type::
0231 configuration_t && a4,
0232 typename utility::nth_backend<typename F::backend_t, 5>::type::
0233 configuration_t && a5,
0234 typename utility::nth_backend<typename F::backend_t, 6>::type::
0235 configuration_t && a6,
0236 typename utility::nth_backend<typename F::backend_t, 7>::type::
0237 configuration_t && a7
0238 )
0239 {
0240 return make_parameter_pack(
0241 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0242 type::configuration_t>(a0),
0243 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0244 type::configuration_t>(a1),
0245 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0246 type::configuration_t>(a2),
0247 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0248 type::configuration_t>(a3),
0249 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0250 type::configuration_t>(a4),
0251 std::forward<typename utility::nth_backend<typename F::backend_t, 5>::
0252 type::configuration_t>(a5),
0253 std::forward<typename utility::nth_backend<typename F::backend_t, 6>::
0254 type::configuration_t>(a6),
0255 std::forward<typename utility::nth_backend<typename F::backend_t, 7>::
0256 type::configuration_t>(a7)
0257 );
0258 }
0259
0260 template <typename F>
0261 requires(utility::backend_depth<typename F::backend_t>::value == 9) auto make_parameter_pack_for(
0262 typename utility::nth_backend<typename F::backend_t, 0>::type::
0263 configuration_t && a0,
0264 typename utility::nth_backend<typename F::backend_t, 1>::type::
0265 configuration_t && a1,
0266 typename utility::nth_backend<typename F::backend_t, 2>::type::
0267 configuration_t && a2,
0268 typename utility::nth_backend<typename F::backend_t, 3>::type::
0269 configuration_t && a3,
0270 typename utility::nth_backend<typename F::backend_t, 4>::type::
0271 configuration_t && a4,
0272 typename utility::nth_backend<typename F::backend_t, 5>::type::
0273 configuration_t && a5,
0274 typename utility::nth_backend<typename F::backend_t, 6>::type::
0275 configuration_t && a6,
0276 typename utility::nth_backend<typename F::backend_t, 7>::type::
0277 configuration_t && a7,
0278 typename utility::nth_backend<typename F::backend_t, 8>::type::
0279 configuration_t && a8
0280 )
0281 {
0282 return make_parameter_pack(
0283 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0284 type::configuration_t>(a0),
0285 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0286 type::configuration_t>(a1),
0287 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0288 type::configuration_t>(a2),
0289 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0290 type::configuration_t>(a3),
0291 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0292 type::configuration_t>(a4),
0293 std::forward<typename utility::nth_backend<typename F::backend_t, 5>::
0294 type::configuration_t>(a5),
0295 std::forward<typename utility::nth_backend<typename F::backend_t, 6>::
0296 type::configuration_t>(a6),
0297 std::forward<typename utility::nth_backend<typename F::backend_t, 7>::
0298 type::configuration_t>(a7),
0299 std::forward<typename utility::nth_backend<typename F::backend_t, 8>::
0300 type::configuration_t>(a8)
0301 );
0302 }
0303
0304 template <typename F>
0305 requires(utility::backend_depth<typename F::backend_t>::value == 10) auto make_parameter_pack_for(
0306 typename utility::nth_backend<typename F::backend_t, 0>::type::
0307 configuration_t && a0,
0308 typename utility::nth_backend<typename F::backend_t, 1>::type::
0309 configuration_t && a1,
0310 typename utility::nth_backend<typename F::backend_t, 2>::type::
0311 configuration_t && a2,
0312 typename utility::nth_backend<typename F::backend_t, 3>::type::
0313 configuration_t && a3,
0314 typename utility::nth_backend<typename F::backend_t, 4>::type::
0315 configuration_t && a4,
0316 typename utility::nth_backend<typename F::backend_t, 5>::type::
0317 configuration_t && a5,
0318 typename utility::nth_backend<typename F::backend_t, 6>::type::
0319 configuration_t && a6,
0320 typename utility::nth_backend<typename F::backend_t, 7>::type::
0321 configuration_t && a7,
0322 typename utility::nth_backend<typename F::backend_t, 8>::type::
0323 configuration_t && a8,
0324 typename utility::nth_backend<typename F::backend_t, 9>::type::
0325 configuration_t && a9
0326 )
0327 {
0328 return make_parameter_pack(
0329 std::forward<typename utility::nth_backend<typename F::backend_t, 0>::
0330 type::configuration_t>(a0),
0331 std::forward<typename utility::nth_backend<typename F::backend_t, 1>::
0332 type::configuration_t>(a1),
0333 std::forward<typename utility::nth_backend<typename F::backend_t, 2>::
0334 type::configuration_t>(a2),
0335 std::forward<typename utility::nth_backend<typename F::backend_t, 3>::
0336 type::configuration_t>(a3),
0337 std::forward<typename utility::nth_backend<typename F::backend_t, 4>::
0338 type::configuration_t>(a4),
0339 std::forward<typename utility::nth_backend<typename F::backend_t, 5>::
0340 type::configuration_t>(a5),
0341 std::forward<typename utility::nth_backend<typename F::backend_t, 6>::
0342 type::configuration_t>(a6),
0343 std::forward<typename utility::nth_backend<typename F::backend_t, 7>::
0344 type::configuration_t>(a7),
0345 std::forward<typename utility::nth_backend<typename F::backend_t, 8>::
0346 type::configuration_t>(a8),
0347 std::forward<typename utility::nth_backend<typename F::backend_t, 9>::
0348 type::configuration_t>(a9)
0349 );
0350 }
0351 }