1 /////////////////////////////////////////////////////////////////////////////// 2 /// \file generate_by_value.hpp 3 /// Contains definition of by_value_generator_\<\> class template. 4 // 5 // Copyright 2008 Eric Niebler. Distributed under the Boost 6 // Software License, Version 1.0. (See accompanying file 7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 template<typename Tag , typename Arg0 > 9 struct by_value_generator_< 10 proto::expr<Tag, list1<Arg0>, 1> 11 > 12 { 13 typedef 14 list1<Arg0> 15 src_args; 16 typedef 17 list1< 18 typename uncvref<Arg0 >::type 19 > 20 dst_args; 21 typedef proto::expr<Tag, src_args, 1> src_type; 22 typedef proto::expr<Tag, dst_args, 1> type; 23 BOOST_FORCEINLINE callby_value_generator_24 static type const call(src_type const &e) 25 { 26 type that = { 27 e.child0 28 }; 29 return that; 30 } 31 }; 32 template<typename Tag , typename Arg0 > 33 struct by_value_generator_< 34 proto::basic_expr<Tag, list1<Arg0>, 1> 35 > 36 { 37 typedef 38 list1<Arg0> 39 src_args; 40 typedef 41 list1< 42 typename uncvref<Arg0 >::type 43 > 44 dst_args; 45 typedef proto::basic_expr<Tag, src_args, 1> src_type; 46 typedef proto::basic_expr<Tag, dst_args, 1> type; 47 BOOST_FORCEINLINE callby_value_generator_48 static type const call(src_type const &e) 49 { 50 type that = { 51 e.child0 52 }; 53 return that; 54 } 55 }; 56 template<typename Tag , typename Arg0 , typename Arg1 > 57 struct by_value_generator_< 58 proto::expr<Tag, list2<Arg0 , Arg1>, 2> 59 > 60 { 61 typedef 62 list2<Arg0 , Arg1> 63 src_args; 64 typedef 65 list2< 66 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type 67 > 68 dst_args; 69 typedef proto::expr<Tag, src_args, 2> src_type; 70 typedef proto::expr<Tag, dst_args, 2> type; 71 BOOST_FORCEINLINE callby_value_generator_72 static type const call(src_type const &e) 73 { 74 type that = { 75 e.child0 , e.child1 76 }; 77 return that; 78 } 79 }; 80 template<typename Tag , typename Arg0 , typename Arg1 > 81 struct by_value_generator_< 82 proto::basic_expr<Tag, list2<Arg0 , Arg1>, 2> 83 > 84 { 85 typedef 86 list2<Arg0 , Arg1> 87 src_args; 88 typedef 89 list2< 90 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type 91 > 92 dst_args; 93 typedef proto::basic_expr<Tag, src_args, 2> src_type; 94 typedef proto::basic_expr<Tag, dst_args, 2> type; 95 BOOST_FORCEINLINE callby_value_generator_96 static type const call(src_type const &e) 97 { 98 type that = { 99 e.child0 , e.child1 100 }; 101 return that; 102 } 103 }; 104 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 > 105 struct by_value_generator_< 106 proto::expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3> 107 > 108 { 109 typedef 110 list3<Arg0 , Arg1 , Arg2> 111 src_args; 112 typedef 113 list3< 114 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type 115 > 116 dst_args; 117 typedef proto::expr<Tag, src_args, 3> src_type; 118 typedef proto::expr<Tag, dst_args, 3> type; 119 BOOST_FORCEINLINE callby_value_generator_120 static type const call(src_type const &e) 121 { 122 type that = { 123 e.child0 , e.child1 , e.child2 124 }; 125 return that; 126 } 127 }; 128 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 > 129 struct by_value_generator_< 130 proto::basic_expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3> 131 > 132 { 133 typedef 134 list3<Arg0 , Arg1 , Arg2> 135 src_args; 136 typedef 137 list3< 138 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type 139 > 140 dst_args; 141 typedef proto::basic_expr<Tag, src_args, 3> src_type; 142 typedef proto::basic_expr<Tag, dst_args, 3> type; 143 BOOST_FORCEINLINE callby_value_generator_144 static type const call(src_type const &e) 145 { 146 type that = { 147 e.child0 , e.child1 , e.child2 148 }; 149 return that; 150 } 151 }; 152 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 > 153 struct by_value_generator_< 154 proto::expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4> 155 > 156 { 157 typedef 158 list4<Arg0 , Arg1 , Arg2 , Arg3> 159 src_args; 160 typedef 161 list4< 162 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type 163 > 164 dst_args; 165 typedef proto::expr<Tag, src_args, 4> src_type; 166 typedef proto::expr<Tag, dst_args, 4> type; 167 BOOST_FORCEINLINE callby_value_generator_168 static type const call(src_type const &e) 169 { 170 type that = { 171 e.child0 , e.child1 , e.child2 , e.child3 172 }; 173 return that; 174 } 175 }; 176 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 > 177 struct by_value_generator_< 178 proto::basic_expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4> 179 > 180 { 181 typedef 182 list4<Arg0 , Arg1 , Arg2 , Arg3> 183 src_args; 184 typedef 185 list4< 186 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type 187 > 188 dst_args; 189 typedef proto::basic_expr<Tag, src_args, 4> src_type; 190 typedef proto::basic_expr<Tag, dst_args, 4> type; 191 BOOST_FORCEINLINE callby_value_generator_192 static type const call(src_type const &e) 193 { 194 type that = { 195 e.child0 , e.child1 , e.child2 , e.child3 196 }; 197 return that; 198 } 199 }; 200 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 > 201 struct by_value_generator_< 202 proto::expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5> 203 > 204 { 205 typedef 206 list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> 207 src_args; 208 typedef 209 list5< 210 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type 211 > 212 dst_args; 213 typedef proto::expr<Tag, src_args, 5> src_type; 214 typedef proto::expr<Tag, dst_args, 5> type; 215 BOOST_FORCEINLINE callby_value_generator_216 static type const call(src_type const &e) 217 { 218 type that = { 219 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 220 }; 221 return that; 222 } 223 }; 224 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 > 225 struct by_value_generator_< 226 proto::basic_expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5> 227 > 228 { 229 typedef 230 list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> 231 src_args; 232 typedef 233 list5< 234 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type 235 > 236 dst_args; 237 typedef proto::basic_expr<Tag, src_args, 5> src_type; 238 typedef proto::basic_expr<Tag, dst_args, 5> type; 239 BOOST_FORCEINLINE callby_value_generator_240 static type const call(src_type const &e) 241 { 242 type that = { 243 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 244 }; 245 return that; 246 } 247 }; 248 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 > 249 struct by_value_generator_< 250 proto::expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6> 251 > 252 { 253 typedef 254 list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> 255 src_args; 256 typedef 257 list6< 258 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type 259 > 260 dst_args; 261 typedef proto::expr<Tag, src_args, 6> src_type; 262 typedef proto::expr<Tag, dst_args, 6> type; 263 BOOST_FORCEINLINE callby_value_generator_264 static type const call(src_type const &e) 265 { 266 type that = { 267 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 268 }; 269 return that; 270 } 271 }; 272 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 > 273 struct by_value_generator_< 274 proto::basic_expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6> 275 > 276 { 277 typedef 278 list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> 279 src_args; 280 typedef 281 list6< 282 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type 283 > 284 dst_args; 285 typedef proto::basic_expr<Tag, src_args, 6> src_type; 286 typedef proto::basic_expr<Tag, dst_args, 6> type; 287 BOOST_FORCEINLINE callby_value_generator_288 static type const call(src_type const &e) 289 { 290 type that = { 291 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 292 }; 293 return that; 294 } 295 }; 296 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 > 297 struct by_value_generator_< 298 proto::expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7> 299 > 300 { 301 typedef 302 list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> 303 src_args; 304 typedef 305 list7< 306 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type 307 > 308 dst_args; 309 typedef proto::expr<Tag, src_args, 7> src_type; 310 typedef proto::expr<Tag, dst_args, 7> type; 311 BOOST_FORCEINLINE callby_value_generator_312 static type const call(src_type const &e) 313 { 314 type that = { 315 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 316 }; 317 return that; 318 } 319 }; 320 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 > 321 struct by_value_generator_< 322 proto::basic_expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7> 323 > 324 { 325 typedef 326 list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> 327 src_args; 328 typedef 329 list7< 330 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type 331 > 332 dst_args; 333 typedef proto::basic_expr<Tag, src_args, 7> src_type; 334 typedef proto::basic_expr<Tag, dst_args, 7> type; 335 BOOST_FORCEINLINE callby_value_generator_336 static type const call(src_type const &e) 337 { 338 type that = { 339 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 340 }; 341 return that; 342 } 343 }; 344 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 > 345 struct by_value_generator_< 346 proto::expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8> 347 > 348 { 349 typedef 350 list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> 351 src_args; 352 typedef 353 list8< 354 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type 355 > 356 dst_args; 357 typedef proto::expr<Tag, src_args, 8> src_type; 358 typedef proto::expr<Tag, dst_args, 8> type; 359 BOOST_FORCEINLINE callby_value_generator_360 static type const call(src_type const &e) 361 { 362 type that = { 363 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 364 }; 365 return that; 366 } 367 }; 368 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 > 369 struct by_value_generator_< 370 proto::basic_expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8> 371 > 372 { 373 typedef 374 list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> 375 src_args; 376 typedef 377 list8< 378 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type 379 > 380 dst_args; 381 typedef proto::basic_expr<Tag, src_args, 8> src_type; 382 typedef proto::basic_expr<Tag, dst_args, 8> type; 383 BOOST_FORCEINLINE callby_value_generator_384 static type const call(src_type const &e) 385 { 386 type that = { 387 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 388 }; 389 return that; 390 } 391 }; 392 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 > 393 struct by_value_generator_< 394 proto::expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9> 395 > 396 { 397 typedef 398 list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> 399 src_args; 400 typedef 401 list9< 402 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type 403 > 404 dst_args; 405 typedef proto::expr<Tag, src_args, 9> src_type; 406 typedef proto::expr<Tag, dst_args, 9> type; 407 BOOST_FORCEINLINE callby_value_generator_408 static type const call(src_type const &e) 409 { 410 type that = { 411 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 412 }; 413 return that; 414 } 415 }; 416 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 > 417 struct by_value_generator_< 418 proto::basic_expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9> 419 > 420 { 421 typedef 422 list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> 423 src_args; 424 typedef 425 list9< 426 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type 427 > 428 dst_args; 429 typedef proto::basic_expr<Tag, src_args, 9> src_type; 430 typedef proto::basic_expr<Tag, dst_args, 9> type; 431 BOOST_FORCEINLINE callby_value_generator_432 static type const call(src_type const &e) 433 { 434 type that = { 435 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 436 }; 437 return that; 438 } 439 }; 440 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 > 441 struct by_value_generator_< 442 proto::expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10> 443 > 444 { 445 typedef 446 list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> 447 src_args; 448 typedef 449 list10< 450 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type 451 > 452 dst_args; 453 typedef proto::expr<Tag, src_args, 10> src_type; 454 typedef proto::expr<Tag, dst_args, 10> type; 455 BOOST_FORCEINLINE callby_value_generator_456 static type const call(src_type const &e) 457 { 458 type that = { 459 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9 460 }; 461 return that; 462 } 463 }; 464 template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9 > 465 struct by_value_generator_< 466 proto::basic_expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10> 467 > 468 { 469 typedef 470 list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> 471 src_args; 472 typedef 473 list10< 474 typename uncvref<Arg0 >::type , typename uncvref<Arg1 >::type , typename uncvref<Arg2 >::type , typename uncvref<Arg3 >::type , typename uncvref<Arg4 >::type , typename uncvref<Arg5 >::type , typename uncvref<Arg6 >::type , typename uncvref<Arg7 >::type , typename uncvref<Arg8 >::type , typename uncvref<Arg9 >::type 475 > 476 dst_args; 477 typedef proto::basic_expr<Tag, src_args, 10> src_type; 478 typedef proto::basic_expr<Tag, dst_args, 10> type; 479 BOOST_FORCEINLINE callby_value_generator_480 static type const call(src_type const &e) 481 { 482 type that = { 483 e.child0 , e.child1 , e.child2 , e.child3 , e.child4 , e.child5 , e.child6 , e.child7 , e.child8 , e.child9 484 }; 485 return that; 486 } 487 }; 488