expr_variadic.hpp 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file expr_variadic.hpp
  3. /// Contains definition of expr\<\> 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 expr<Tag, term<Arg0>, 0>
  10. {
  11. typedef Tag proto_tag;
  12. static const long proto_arity_c = 0;
  13. typedef mpl::long_<0 > proto_arity;
  14. typedef expr proto_base_expr;
  15. typedef term<Arg0> proto_args;
  16. typedef basic_expr<Tag, proto_args, 0 > proto_grammar;
  17. typedef default_domain proto_domain;
  18. typedef default_generator proto_generator;
  19. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  20. typedef expr proto_derived_expr;
  21. typedef void proto_is_expr_;
  22. typedef Arg0 proto_child0; proto_child0 child0;
  23. typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  24. BOOST_FORCEINLINE
  25. expr const &proto_base() const
  26. {
  27. return *this;
  28. }
  29. BOOST_FORCEINLINE
  30. expr &proto_base()
  31. {
  32. return *this;
  33. }
  34. template<typename A0>
  35. BOOST_FORCEINLINE
  36. static expr const make(A0 &a0)
  37. {
  38. return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
  39. }
  40. template<typename A0>
  41. BOOST_FORCEINLINE
  42. static expr const make(A0 const &a0)
  43. {
  44. return detail::make_terminal(a0, static_cast<expr *>(0), static_cast<proto_args *>(0));
  45. }
  46. typedef detail::not_a_valid_type address_of_hack_type_;
  47. BOOST_FORCEINLINE
  48. proto::expr<
  49. proto::tag::assign
  50. , list2<expr &, expr const &>
  51. , 2
  52. > const
  53. operator =(expr const &a)
  54. {
  55. proto::expr<
  56. proto::tag::assign
  57. , list2<expr &, expr const &>
  58. , 2
  59. > that = {*this, a};
  60. return that;
  61. }
  62. template<typename A>
  63. BOOST_FORCEINLINE
  64. proto::expr<
  65. proto::tag::assign
  66. , list2<expr const &, typename result_of::as_child<A>::type>
  67. , 2
  68. > const
  69. operator =(A &a) const
  70. {
  71. proto::expr<
  72. proto::tag::assign
  73. , list2<expr const &, typename result_of::as_child<A>::type>
  74. , 2
  75. > that = {*this, proto::as_child(a)};
  76. return that;
  77. }
  78. template<typename A>
  79. BOOST_FORCEINLINE
  80. proto::expr<
  81. proto::tag::assign
  82. , list2<expr const &, typename result_of::as_child<A const>::type>
  83. , 2
  84. > const
  85. operator =(A const &a) const
  86. {
  87. proto::expr<
  88. proto::tag::assign
  89. , list2<expr const &, typename result_of::as_child<A const>::type>
  90. , 2
  91. > that = {*this, proto::as_child(a)};
  92. return that;
  93. }
  94. template<typename A>
  95. BOOST_FORCEINLINE
  96. proto::expr<
  97. proto::tag::assign
  98. , list2<expr &, typename result_of::as_child<A>::type>
  99. , 2
  100. > const
  101. operator =(A &a)
  102. {
  103. proto::expr<
  104. proto::tag::assign
  105. , list2<expr &, typename result_of::as_child<A>::type>
  106. , 2
  107. > that = {*this, proto::as_child(a)};
  108. return that;
  109. }
  110. template<typename A>
  111. BOOST_FORCEINLINE
  112. proto::expr<
  113. proto::tag::assign
  114. , list2<expr &, typename result_of::as_child<A const>::type>
  115. , 2
  116. > const
  117. operator =(A const &a)
  118. {
  119. proto::expr<
  120. proto::tag::assign
  121. , list2<expr &, typename result_of::as_child<A const>::type>
  122. , 2
  123. > that = {*this, proto::as_child(a)};
  124. return that;
  125. }
  126. template<typename A>
  127. BOOST_FORCEINLINE
  128. proto::expr<
  129. proto::tag::subscript
  130. , list2<expr const &, typename result_of::as_child<A>::type>
  131. , 2
  132. > const
  133. operator [](A &a) const
  134. {
  135. proto::expr<
  136. proto::tag::subscript
  137. , list2<expr const &, typename result_of::as_child<A>::type>
  138. , 2
  139. > that = {*this, proto::as_child(a)};
  140. return that;
  141. }
  142. template<typename A>
  143. BOOST_FORCEINLINE
  144. proto::expr<
  145. proto::tag::subscript
  146. , list2<expr const &, typename result_of::as_child<A const>::type>
  147. , 2
  148. > const
  149. operator [](A const &a) const
  150. {
  151. proto::expr<
  152. proto::tag::subscript
  153. , list2<expr const &, typename result_of::as_child<A const>::type>
  154. , 2
  155. > that = {*this, proto::as_child(a)};
  156. return that;
  157. }
  158. template<typename A>
  159. BOOST_FORCEINLINE
  160. proto::expr<
  161. proto::tag::subscript
  162. , list2<expr &, typename result_of::as_child<A>::type>
  163. , 2
  164. > const
  165. operator [](A &a)
  166. {
  167. proto::expr<
  168. proto::tag::subscript
  169. , list2<expr &, typename result_of::as_child<A>::type>
  170. , 2
  171. > that = {*this, proto::as_child(a)};
  172. return that;
  173. }
  174. template<typename A>
  175. BOOST_FORCEINLINE
  176. proto::expr<
  177. proto::tag::subscript
  178. , list2<expr &, typename result_of::as_child<A const>::type>
  179. , 2
  180. > const
  181. operator [](A const &a)
  182. {
  183. proto::expr<
  184. proto::tag::subscript
  185. , list2<expr &, typename result_of::as_child<A const>::type>
  186. , 2
  187. > that = {*this, proto::as_child(a)};
  188. return that;
  189. }
  190. template<typename Sig>
  191. struct result
  192. {
  193. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  194. };
  195. template<typename ...A>
  196. BOOST_FORCEINLINE
  197. typename result_of::funop<
  198. expr const(A const &...)
  199. , expr
  200. , default_domain
  201. >::type const
  202. operator ()(A const &... a) const
  203. {
  204. return result_of::funop<
  205. expr const(A const &...)
  206. , expr
  207. , default_domain
  208. >::call(*this, a...);
  209. }
  210. template<typename ...A>
  211. BOOST_FORCEINLINE
  212. typename result_of::funop<
  213. expr(A const &...)
  214. , expr
  215. , default_domain
  216. >::type const
  217. operator ()(A const &... a)
  218. {
  219. return result_of::funop<
  220. expr(A const &...)
  221. , expr
  222. , default_domain
  223. >::call(*this, a...);
  224. }
  225. };
  226. template<typename Tag , typename Arg0>
  227. struct expr<Tag, list1<Arg0>, 1 >
  228. {
  229. typedef Tag proto_tag;
  230. static const long proto_arity_c = 1;
  231. typedef mpl::long_<1 > proto_arity;
  232. typedef expr proto_base_expr;
  233. typedef list1<Arg0> proto_args;
  234. typedef basic_expr<Tag, proto_args, 1 > proto_grammar;
  235. typedef default_domain proto_domain;
  236. typedef default_generator proto_generator;
  237. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  238. typedef expr proto_derived_expr;
  239. typedef void proto_is_expr_;
  240. typedef Arg0 proto_child0; proto_child0 child0;
  241. typedef void proto_child1; typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  242. BOOST_FORCEINLINE
  243. expr const &proto_base() const
  244. {
  245. return *this;
  246. }
  247. BOOST_FORCEINLINE
  248. expr &proto_base()
  249. {
  250. return *this;
  251. }
  252. template<typename A0>
  253. BOOST_FORCEINLINE
  254. static expr const make(A0 const &a0)
  255. {
  256. expr that = {a0};
  257. return that;
  258. }
  259. typedef typename detail::address_of_hack<Tag, proto_child0>::type address_of_hack_type_;
  260. BOOST_FORCEINLINE
  261. operator address_of_hack_type_() const
  262. {
  263. return boost::addressof(this->child0);
  264. }
  265. BOOST_FORCEINLINE
  266. proto::expr<
  267. proto::tag::assign
  268. , list2<expr &, expr const &>
  269. , 2
  270. > const
  271. operator =(expr const &a)
  272. {
  273. proto::expr<
  274. proto::tag::assign
  275. , list2<expr &, expr const &>
  276. , 2
  277. > that = {*this, a};
  278. return that;
  279. }
  280. template<typename A>
  281. BOOST_FORCEINLINE
  282. proto::expr<
  283. proto::tag::assign
  284. , list2<expr const &, typename result_of::as_child<A>::type>
  285. , 2
  286. > const
  287. operator =(A &a) const
  288. {
  289. proto::expr<
  290. proto::tag::assign
  291. , list2<expr const &, typename result_of::as_child<A>::type>
  292. , 2
  293. > that = {*this, proto::as_child(a)};
  294. return that;
  295. }
  296. template<typename A>
  297. BOOST_FORCEINLINE
  298. proto::expr<
  299. proto::tag::assign
  300. , list2<expr const &, typename result_of::as_child<A const>::type>
  301. , 2
  302. > const
  303. operator =(A const &a) const
  304. {
  305. proto::expr<
  306. proto::tag::assign
  307. , list2<expr const &, typename result_of::as_child<A const>::type>
  308. , 2
  309. > that = {*this, proto::as_child(a)};
  310. return that;
  311. }
  312. template<typename A>
  313. BOOST_FORCEINLINE
  314. proto::expr<
  315. proto::tag::subscript
  316. , list2<expr const &, typename result_of::as_child<A>::type>
  317. , 2
  318. > const
  319. operator [](A &a) const
  320. {
  321. proto::expr<
  322. proto::tag::subscript
  323. , list2<expr const &, typename result_of::as_child<A>::type>
  324. , 2
  325. > that = {*this, proto::as_child(a)};
  326. return that;
  327. }
  328. template<typename A>
  329. BOOST_FORCEINLINE
  330. proto::expr<
  331. proto::tag::subscript
  332. , list2<expr const &, typename result_of::as_child<A const>::type>
  333. , 2
  334. > const
  335. operator [](A const &a) const
  336. {
  337. proto::expr<
  338. proto::tag::subscript
  339. , list2<expr const &, typename result_of::as_child<A const>::type>
  340. , 2
  341. > that = {*this, proto::as_child(a)};
  342. return that;
  343. }
  344. template<typename Sig>
  345. struct result
  346. {
  347. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  348. };
  349. template<typename ...A>
  350. BOOST_FORCEINLINE
  351. typename result_of::funop<
  352. expr const(A const &...)
  353. , expr
  354. , default_domain
  355. >::type const
  356. operator ()(A const &... a) const
  357. {
  358. return result_of::funop<
  359. expr const(A const &...)
  360. , expr
  361. , default_domain
  362. >::call(*this, a...);
  363. }
  364. };
  365. template<typename Tag , typename Arg0 , typename Arg1>
  366. struct expr<Tag, list2<Arg0 , Arg1>, 2 >
  367. {
  368. typedef Tag proto_tag;
  369. static const long proto_arity_c = 2;
  370. typedef mpl::long_<2 > proto_arity;
  371. typedef expr proto_base_expr;
  372. typedef list2<Arg0 , Arg1> proto_args;
  373. typedef basic_expr<Tag, proto_args, 2 > proto_grammar;
  374. typedef default_domain proto_domain;
  375. typedef default_generator proto_generator;
  376. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  377. typedef expr proto_derived_expr;
  378. typedef void proto_is_expr_;
  379. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1;
  380. typedef void proto_child2; typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  381. BOOST_FORCEINLINE
  382. expr const &proto_base() const
  383. {
  384. return *this;
  385. }
  386. BOOST_FORCEINLINE
  387. expr &proto_base()
  388. {
  389. return *this;
  390. }
  391. template<typename A0 , typename A1>
  392. BOOST_FORCEINLINE
  393. static expr const make(A0 const &a0 , A1 const &a1)
  394. {
  395. expr that = {a0 , a1};
  396. return that;
  397. }
  398. typedef detail::not_a_valid_type address_of_hack_type_;
  399. BOOST_FORCEINLINE
  400. proto::expr<
  401. proto::tag::assign
  402. , list2<expr &, expr const &>
  403. , 2
  404. > const
  405. operator =(expr const &a)
  406. {
  407. proto::expr<
  408. proto::tag::assign
  409. , list2<expr &, expr const &>
  410. , 2
  411. > that = {*this, a};
  412. return that;
  413. }
  414. template<typename A>
  415. BOOST_FORCEINLINE
  416. proto::expr<
  417. proto::tag::assign
  418. , list2<expr const &, typename result_of::as_child<A>::type>
  419. , 2
  420. > const
  421. operator =(A &a) const
  422. {
  423. proto::expr<
  424. proto::tag::assign
  425. , list2<expr const &, typename result_of::as_child<A>::type>
  426. , 2
  427. > that = {*this, proto::as_child(a)};
  428. return that;
  429. }
  430. template<typename A>
  431. BOOST_FORCEINLINE
  432. proto::expr<
  433. proto::tag::assign
  434. , list2<expr const &, typename result_of::as_child<A const>::type>
  435. , 2
  436. > const
  437. operator =(A const &a) const
  438. {
  439. proto::expr<
  440. proto::tag::assign
  441. , list2<expr const &, typename result_of::as_child<A const>::type>
  442. , 2
  443. > that = {*this, proto::as_child(a)};
  444. return that;
  445. }
  446. template<typename A>
  447. BOOST_FORCEINLINE
  448. proto::expr<
  449. proto::tag::subscript
  450. , list2<expr const &, typename result_of::as_child<A>::type>
  451. , 2
  452. > const
  453. operator [](A &a) const
  454. {
  455. proto::expr<
  456. proto::tag::subscript
  457. , list2<expr const &, typename result_of::as_child<A>::type>
  458. , 2
  459. > that = {*this, proto::as_child(a)};
  460. return that;
  461. }
  462. template<typename A>
  463. BOOST_FORCEINLINE
  464. proto::expr<
  465. proto::tag::subscript
  466. , list2<expr const &, typename result_of::as_child<A const>::type>
  467. , 2
  468. > const
  469. operator [](A const &a) const
  470. {
  471. proto::expr<
  472. proto::tag::subscript
  473. , list2<expr const &, typename result_of::as_child<A const>::type>
  474. , 2
  475. > that = {*this, proto::as_child(a)};
  476. return that;
  477. }
  478. template<typename Sig>
  479. struct result
  480. {
  481. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  482. };
  483. template<typename ...A>
  484. BOOST_FORCEINLINE
  485. typename result_of::funop<
  486. expr const(A const &...)
  487. , expr
  488. , default_domain
  489. >::type const
  490. operator ()(A const &... a) const
  491. {
  492. return result_of::funop<
  493. expr const(A const &...)
  494. , expr
  495. , default_domain
  496. >::call(*this, a...);
  497. }
  498. };
  499. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2>
  500. struct expr<Tag, list3<Arg0 , Arg1 , Arg2>, 3 >
  501. {
  502. typedef Tag proto_tag;
  503. static const long proto_arity_c = 3;
  504. typedef mpl::long_<3 > proto_arity;
  505. typedef expr proto_base_expr;
  506. typedef list3<Arg0 , Arg1 , Arg2> proto_args;
  507. typedef basic_expr<Tag, proto_args, 3 > proto_grammar;
  508. typedef default_domain proto_domain;
  509. typedef default_generator proto_generator;
  510. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  511. typedef expr proto_derived_expr;
  512. typedef void proto_is_expr_;
  513. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2;
  514. typedef void proto_child3; typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  515. BOOST_FORCEINLINE
  516. expr const &proto_base() const
  517. {
  518. return *this;
  519. }
  520. BOOST_FORCEINLINE
  521. expr &proto_base()
  522. {
  523. return *this;
  524. }
  525. template<typename A0 , typename A1 , typename A2>
  526. BOOST_FORCEINLINE
  527. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2)
  528. {
  529. expr that = {a0 , a1 , a2};
  530. return that;
  531. }
  532. typedef detail::not_a_valid_type address_of_hack_type_;
  533. BOOST_FORCEINLINE
  534. proto::expr<
  535. proto::tag::assign
  536. , list2<expr &, expr const &>
  537. , 2
  538. > const
  539. operator =(expr const &a)
  540. {
  541. proto::expr<
  542. proto::tag::assign
  543. , list2<expr &, expr const &>
  544. , 2
  545. > that = {*this, a};
  546. return that;
  547. }
  548. template<typename A>
  549. BOOST_FORCEINLINE
  550. proto::expr<
  551. proto::tag::assign
  552. , list2<expr const &, typename result_of::as_child<A>::type>
  553. , 2
  554. > const
  555. operator =(A &a) const
  556. {
  557. proto::expr<
  558. proto::tag::assign
  559. , list2<expr const &, typename result_of::as_child<A>::type>
  560. , 2
  561. > that = {*this, proto::as_child(a)};
  562. return that;
  563. }
  564. template<typename A>
  565. BOOST_FORCEINLINE
  566. proto::expr<
  567. proto::tag::assign
  568. , list2<expr const &, typename result_of::as_child<A const>::type>
  569. , 2
  570. > const
  571. operator =(A const &a) const
  572. {
  573. proto::expr<
  574. proto::tag::assign
  575. , list2<expr const &, typename result_of::as_child<A const>::type>
  576. , 2
  577. > that = {*this, proto::as_child(a)};
  578. return that;
  579. }
  580. template<typename A>
  581. BOOST_FORCEINLINE
  582. proto::expr<
  583. proto::tag::subscript
  584. , list2<expr const &, typename result_of::as_child<A>::type>
  585. , 2
  586. > const
  587. operator [](A &a) const
  588. {
  589. proto::expr<
  590. proto::tag::subscript
  591. , list2<expr const &, typename result_of::as_child<A>::type>
  592. , 2
  593. > that = {*this, proto::as_child(a)};
  594. return that;
  595. }
  596. template<typename A>
  597. BOOST_FORCEINLINE
  598. proto::expr<
  599. proto::tag::subscript
  600. , list2<expr const &, typename result_of::as_child<A const>::type>
  601. , 2
  602. > const
  603. operator [](A const &a) const
  604. {
  605. proto::expr<
  606. proto::tag::subscript
  607. , list2<expr const &, typename result_of::as_child<A const>::type>
  608. , 2
  609. > that = {*this, proto::as_child(a)};
  610. return that;
  611. }
  612. template<typename Sig>
  613. struct result
  614. {
  615. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  616. };
  617. template<typename ...A>
  618. BOOST_FORCEINLINE
  619. typename result_of::funop<
  620. expr const(A const &...)
  621. , expr
  622. , default_domain
  623. >::type const
  624. operator ()(A const &... a) const
  625. {
  626. return result_of::funop<
  627. expr const(A const &...)
  628. , expr
  629. , default_domain
  630. >::call(*this, a...);
  631. }
  632. };
  633. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3>
  634. struct expr<Tag, list4<Arg0 , Arg1 , Arg2 , Arg3>, 4 >
  635. {
  636. typedef Tag proto_tag;
  637. static const long proto_arity_c = 4;
  638. typedef mpl::long_<4 > proto_arity;
  639. typedef expr proto_base_expr;
  640. typedef list4<Arg0 , Arg1 , Arg2 , Arg3> proto_args;
  641. typedef basic_expr<Tag, proto_args, 4 > proto_grammar;
  642. typedef default_domain proto_domain;
  643. typedef default_generator proto_generator;
  644. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  645. typedef expr proto_derived_expr;
  646. typedef void proto_is_expr_;
  647. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3;
  648. typedef void proto_child4; typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  649. BOOST_FORCEINLINE
  650. expr const &proto_base() const
  651. {
  652. return *this;
  653. }
  654. BOOST_FORCEINLINE
  655. expr &proto_base()
  656. {
  657. return *this;
  658. }
  659. template<typename A0 , typename A1 , typename A2 , typename A3>
  660. BOOST_FORCEINLINE
  661. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3)
  662. {
  663. expr that = {a0 , a1 , a2 , a3};
  664. return that;
  665. }
  666. typedef detail::not_a_valid_type address_of_hack_type_;
  667. BOOST_FORCEINLINE
  668. proto::expr<
  669. proto::tag::assign
  670. , list2<expr &, expr const &>
  671. , 2
  672. > const
  673. operator =(expr const &a)
  674. {
  675. proto::expr<
  676. proto::tag::assign
  677. , list2<expr &, expr const &>
  678. , 2
  679. > that = {*this, a};
  680. return that;
  681. }
  682. template<typename A>
  683. BOOST_FORCEINLINE
  684. proto::expr<
  685. proto::tag::assign
  686. , list2<expr const &, typename result_of::as_child<A>::type>
  687. , 2
  688. > const
  689. operator =(A &a) const
  690. {
  691. proto::expr<
  692. proto::tag::assign
  693. , list2<expr const &, typename result_of::as_child<A>::type>
  694. , 2
  695. > that = {*this, proto::as_child(a)};
  696. return that;
  697. }
  698. template<typename A>
  699. BOOST_FORCEINLINE
  700. proto::expr<
  701. proto::tag::assign
  702. , list2<expr const &, typename result_of::as_child<A const>::type>
  703. , 2
  704. > const
  705. operator =(A const &a) const
  706. {
  707. proto::expr<
  708. proto::tag::assign
  709. , list2<expr const &, typename result_of::as_child<A const>::type>
  710. , 2
  711. > that = {*this, proto::as_child(a)};
  712. return that;
  713. }
  714. template<typename A>
  715. BOOST_FORCEINLINE
  716. proto::expr<
  717. proto::tag::subscript
  718. , list2<expr const &, typename result_of::as_child<A>::type>
  719. , 2
  720. > const
  721. operator [](A &a) const
  722. {
  723. proto::expr<
  724. proto::tag::subscript
  725. , list2<expr const &, typename result_of::as_child<A>::type>
  726. , 2
  727. > that = {*this, proto::as_child(a)};
  728. return that;
  729. }
  730. template<typename A>
  731. BOOST_FORCEINLINE
  732. proto::expr<
  733. proto::tag::subscript
  734. , list2<expr const &, typename result_of::as_child<A const>::type>
  735. , 2
  736. > const
  737. operator [](A const &a) const
  738. {
  739. proto::expr<
  740. proto::tag::subscript
  741. , list2<expr const &, typename result_of::as_child<A const>::type>
  742. , 2
  743. > that = {*this, proto::as_child(a)};
  744. return that;
  745. }
  746. template<typename Sig>
  747. struct result
  748. {
  749. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  750. };
  751. template<typename ...A>
  752. BOOST_FORCEINLINE
  753. typename result_of::funop<
  754. expr const(A const &...)
  755. , expr
  756. , default_domain
  757. >::type const
  758. operator ()(A const &... a) const
  759. {
  760. return result_of::funop<
  761. expr const(A const &...)
  762. , expr
  763. , default_domain
  764. >::call(*this, a...);
  765. }
  766. };
  767. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4>
  768. struct expr<Tag, list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4>, 5 >
  769. {
  770. typedef Tag proto_tag;
  771. static const long proto_arity_c = 5;
  772. typedef mpl::long_<5 > proto_arity;
  773. typedef expr proto_base_expr;
  774. typedef list5<Arg0 , Arg1 , Arg2 , Arg3 , Arg4> proto_args;
  775. typedef basic_expr<Tag, proto_args, 5 > proto_grammar;
  776. typedef default_domain proto_domain;
  777. typedef default_generator proto_generator;
  778. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  779. typedef expr proto_derived_expr;
  780. typedef void proto_is_expr_;
  781. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4;
  782. typedef void proto_child5; typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  783. BOOST_FORCEINLINE
  784. expr const &proto_base() const
  785. {
  786. return *this;
  787. }
  788. BOOST_FORCEINLINE
  789. expr &proto_base()
  790. {
  791. return *this;
  792. }
  793. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4>
  794. BOOST_FORCEINLINE
  795. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4)
  796. {
  797. expr that = {a0 , a1 , a2 , a3 , a4};
  798. return that;
  799. }
  800. typedef detail::not_a_valid_type address_of_hack_type_;
  801. BOOST_FORCEINLINE
  802. proto::expr<
  803. proto::tag::assign
  804. , list2<expr &, expr const &>
  805. , 2
  806. > const
  807. operator =(expr const &a)
  808. {
  809. proto::expr<
  810. proto::tag::assign
  811. , list2<expr &, expr const &>
  812. , 2
  813. > that = {*this, a};
  814. return that;
  815. }
  816. template<typename A>
  817. BOOST_FORCEINLINE
  818. proto::expr<
  819. proto::tag::assign
  820. , list2<expr const &, typename result_of::as_child<A>::type>
  821. , 2
  822. > const
  823. operator =(A &a) const
  824. {
  825. proto::expr<
  826. proto::tag::assign
  827. , list2<expr const &, typename result_of::as_child<A>::type>
  828. , 2
  829. > that = {*this, proto::as_child(a)};
  830. return that;
  831. }
  832. template<typename A>
  833. BOOST_FORCEINLINE
  834. proto::expr<
  835. proto::tag::assign
  836. , list2<expr const &, typename result_of::as_child<A const>::type>
  837. , 2
  838. > const
  839. operator =(A const &a) const
  840. {
  841. proto::expr<
  842. proto::tag::assign
  843. , list2<expr const &, typename result_of::as_child<A const>::type>
  844. , 2
  845. > that = {*this, proto::as_child(a)};
  846. return that;
  847. }
  848. template<typename A>
  849. BOOST_FORCEINLINE
  850. proto::expr<
  851. proto::tag::subscript
  852. , list2<expr const &, typename result_of::as_child<A>::type>
  853. , 2
  854. > const
  855. operator [](A &a) const
  856. {
  857. proto::expr<
  858. proto::tag::subscript
  859. , list2<expr const &, typename result_of::as_child<A>::type>
  860. , 2
  861. > that = {*this, proto::as_child(a)};
  862. return that;
  863. }
  864. template<typename A>
  865. BOOST_FORCEINLINE
  866. proto::expr<
  867. proto::tag::subscript
  868. , list2<expr const &, typename result_of::as_child<A const>::type>
  869. , 2
  870. > const
  871. operator [](A const &a) const
  872. {
  873. proto::expr<
  874. proto::tag::subscript
  875. , list2<expr const &, typename result_of::as_child<A const>::type>
  876. , 2
  877. > that = {*this, proto::as_child(a)};
  878. return that;
  879. }
  880. template<typename Sig>
  881. struct result
  882. {
  883. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  884. };
  885. template<typename ...A>
  886. BOOST_FORCEINLINE
  887. typename result_of::funop<
  888. expr const(A const &...)
  889. , expr
  890. , default_domain
  891. >::type const
  892. operator ()(A const &... a) const
  893. {
  894. return result_of::funop<
  895. expr const(A const &...)
  896. , expr
  897. , default_domain
  898. >::call(*this, a...);
  899. }
  900. };
  901. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5>
  902. struct expr<Tag, list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5>, 6 >
  903. {
  904. typedef Tag proto_tag;
  905. static const long proto_arity_c = 6;
  906. typedef mpl::long_<6 > proto_arity;
  907. typedef expr proto_base_expr;
  908. typedef list6<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5> proto_args;
  909. typedef basic_expr<Tag, proto_args, 6 > proto_grammar;
  910. typedef default_domain proto_domain;
  911. typedef default_generator proto_generator;
  912. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  913. typedef expr proto_derived_expr;
  914. typedef void proto_is_expr_;
  915. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5;
  916. typedef void proto_child6; typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  917. BOOST_FORCEINLINE
  918. expr const &proto_base() const
  919. {
  920. return *this;
  921. }
  922. BOOST_FORCEINLINE
  923. expr &proto_base()
  924. {
  925. return *this;
  926. }
  927. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5>
  928. BOOST_FORCEINLINE
  929. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5)
  930. {
  931. expr that = {a0 , a1 , a2 , a3 , a4 , a5};
  932. return that;
  933. }
  934. typedef detail::not_a_valid_type address_of_hack_type_;
  935. BOOST_FORCEINLINE
  936. proto::expr<
  937. proto::tag::assign
  938. , list2<expr &, expr const &>
  939. , 2
  940. > const
  941. operator =(expr const &a)
  942. {
  943. proto::expr<
  944. proto::tag::assign
  945. , list2<expr &, expr const &>
  946. , 2
  947. > that = {*this, a};
  948. return that;
  949. }
  950. template<typename A>
  951. BOOST_FORCEINLINE
  952. proto::expr<
  953. proto::tag::assign
  954. , list2<expr const &, typename result_of::as_child<A>::type>
  955. , 2
  956. > const
  957. operator =(A &a) const
  958. {
  959. proto::expr<
  960. proto::tag::assign
  961. , list2<expr const &, typename result_of::as_child<A>::type>
  962. , 2
  963. > that = {*this, proto::as_child(a)};
  964. return that;
  965. }
  966. template<typename A>
  967. BOOST_FORCEINLINE
  968. proto::expr<
  969. proto::tag::assign
  970. , list2<expr const &, typename result_of::as_child<A const>::type>
  971. , 2
  972. > const
  973. operator =(A const &a) const
  974. {
  975. proto::expr<
  976. proto::tag::assign
  977. , list2<expr const &, typename result_of::as_child<A const>::type>
  978. , 2
  979. > that = {*this, proto::as_child(a)};
  980. return that;
  981. }
  982. template<typename A>
  983. BOOST_FORCEINLINE
  984. proto::expr<
  985. proto::tag::subscript
  986. , list2<expr const &, typename result_of::as_child<A>::type>
  987. , 2
  988. > const
  989. operator [](A &a) const
  990. {
  991. proto::expr<
  992. proto::tag::subscript
  993. , list2<expr const &, typename result_of::as_child<A>::type>
  994. , 2
  995. > that = {*this, proto::as_child(a)};
  996. return that;
  997. }
  998. template<typename A>
  999. BOOST_FORCEINLINE
  1000. proto::expr<
  1001. proto::tag::subscript
  1002. , list2<expr const &, typename result_of::as_child<A const>::type>
  1003. , 2
  1004. > const
  1005. operator [](A const &a) const
  1006. {
  1007. proto::expr<
  1008. proto::tag::subscript
  1009. , list2<expr const &, typename result_of::as_child<A const>::type>
  1010. , 2
  1011. > that = {*this, proto::as_child(a)};
  1012. return that;
  1013. }
  1014. template<typename Sig>
  1015. struct result
  1016. {
  1017. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  1018. };
  1019. template<typename ...A>
  1020. BOOST_FORCEINLINE
  1021. typename result_of::funop<
  1022. expr const(A const &...)
  1023. , expr
  1024. , default_domain
  1025. >::type const
  1026. operator ()(A const &... a) const
  1027. {
  1028. return result_of::funop<
  1029. expr const(A const &...)
  1030. , expr
  1031. , default_domain
  1032. >::call(*this, a...);
  1033. }
  1034. };
  1035. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6>
  1036. struct expr<Tag, list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6>, 7 >
  1037. {
  1038. typedef Tag proto_tag;
  1039. static const long proto_arity_c = 7;
  1040. typedef mpl::long_<7 > proto_arity;
  1041. typedef expr proto_base_expr;
  1042. typedef list7<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6> proto_args;
  1043. typedef basic_expr<Tag, proto_args, 7 > proto_grammar;
  1044. typedef default_domain proto_domain;
  1045. typedef default_generator proto_generator;
  1046. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  1047. typedef expr proto_derived_expr;
  1048. typedef void proto_is_expr_;
  1049. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6;
  1050. typedef void proto_child7; typedef void proto_child8; typedef void proto_child9;
  1051. BOOST_FORCEINLINE
  1052. expr const &proto_base() const
  1053. {
  1054. return *this;
  1055. }
  1056. BOOST_FORCEINLINE
  1057. expr &proto_base()
  1058. {
  1059. return *this;
  1060. }
  1061. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6>
  1062. BOOST_FORCEINLINE
  1063. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6)
  1064. {
  1065. expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6};
  1066. return that;
  1067. }
  1068. typedef detail::not_a_valid_type address_of_hack_type_;
  1069. BOOST_FORCEINLINE
  1070. proto::expr<
  1071. proto::tag::assign
  1072. , list2<expr &, expr const &>
  1073. , 2
  1074. > const
  1075. operator =(expr const &a)
  1076. {
  1077. proto::expr<
  1078. proto::tag::assign
  1079. , list2<expr &, expr const &>
  1080. , 2
  1081. > that = {*this, a};
  1082. return that;
  1083. }
  1084. template<typename A>
  1085. BOOST_FORCEINLINE
  1086. proto::expr<
  1087. proto::tag::assign
  1088. , list2<expr const &, typename result_of::as_child<A>::type>
  1089. , 2
  1090. > const
  1091. operator =(A &a) const
  1092. {
  1093. proto::expr<
  1094. proto::tag::assign
  1095. , list2<expr const &, typename result_of::as_child<A>::type>
  1096. , 2
  1097. > that = {*this, proto::as_child(a)};
  1098. return that;
  1099. }
  1100. template<typename A>
  1101. BOOST_FORCEINLINE
  1102. proto::expr<
  1103. proto::tag::assign
  1104. , list2<expr const &, typename result_of::as_child<A const>::type>
  1105. , 2
  1106. > const
  1107. operator =(A const &a) const
  1108. {
  1109. proto::expr<
  1110. proto::tag::assign
  1111. , list2<expr const &, typename result_of::as_child<A const>::type>
  1112. , 2
  1113. > that = {*this, proto::as_child(a)};
  1114. return that;
  1115. }
  1116. template<typename A>
  1117. BOOST_FORCEINLINE
  1118. proto::expr<
  1119. proto::tag::subscript
  1120. , list2<expr const &, typename result_of::as_child<A>::type>
  1121. , 2
  1122. > const
  1123. operator [](A &a) const
  1124. {
  1125. proto::expr<
  1126. proto::tag::subscript
  1127. , list2<expr const &, typename result_of::as_child<A>::type>
  1128. , 2
  1129. > that = {*this, proto::as_child(a)};
  1130. return that;
  1131. }
  1132. template<typename A>
  1133. BOOST_FORCEINLINE
  1134. proto::expr<
  1135. proto::tag::subscript
  1136. , list2<expr const &, typename result_of::as_child<A const>::type>
  1137. , 2
  1138. > const
  1139. operator [](A const &a) const
  1140. {
  1141. proto::expr<
  1142. proto::tag::subscript
  1143. , list2<expr const &, typename result_of::as_child<A const>::type>
  1144. , 2
  1145. > that = {*this, proto::as_child(a)};
  1146. return that;
  1147. }
  1148. template<typename Sig>
  1149. struct result
  1150. {
  1151. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  1152. };
  1153. template<typename ...A>
  1154. BOOST_FORCEINLINE
  1155. typename result_of::funop<
  1156. expr const(A const &...)
  1157. , expr
  1158. , default_domain
  1159. >::type const
  1160. operator ()(A const &... a) const
  1161. {
  1162. return result_of::funop<
  1163. expr const(A const &...)
  1164. , expr
  1165. , default_domain
  1166. >::call(*this, a...);
  1167. }
  1168. };
  1169. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7>
  1170. struct expr<Tag, list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7>, 8 >
  1171. {
  1172. typedef Tag proto_tag;
  1173. static const long proto_arity_c = 8;
  1174. typedef mpl::long_<8 > proto_arity;
  1175. typedef expr proto_base_expr;
  1176. typedef list8<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7> proto_args;
  1177. typedef basic_expr<Tag, proto_args, 8 > proto_grammar;
  1178. typedef default_domain proto_domain;
  1179. typedef default_generator proto_generator;
  1180. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  1181. typedef expr proto_derived_expr;
  1182. typedef void proto_is_expr_;
  1183. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7;
  1184. typedef void proto_child8; typedef void proto_child9;
  1185. BOOST_FORCEINLINE
  1186. expr const &proto_base() const
  1187. {
  1188. return *this;
  1189. }
  1190. BOOST_FORCEINLINE
  1191. expr &proto_base()
  1192. {
  1193. return *this;
  1194. }
  1195. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7>
  1196. BOOST_FORCEINLINE
  1197. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7)
  1198. {
  1199. expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7};
  1200. return that;
  1201. }
  1202. typedef detail::not_a_valid_type address_of_hack_type_;
  1203. BOOST_FORCEINLINE
  1204. proto::expr<
  1205. proto::tag::assign
  1206. , list2<expr &, expr const &>
  1207. , 2
  1208. > const
  1209. operator =(expr const &a)
  1210. {
  1211. proto::expr<
  1212. proto::tag::assign
  1213. , list2<expr &, expr const &>
  1214. , 2
  1215. > that = {*this, a};
  1216. return that;
  1217. }
  1218. template<typename A>
  1219. BOOST_FORCEINLINE
  1220. proto::expr<
  1221. proto::tag::assign
  1222. , list2<expr const &, typename result_of::as_child<A>::type>
  1223. , 2
  1224. > const
  1225. operator =(A &a) const
  1226. {
  1227. proto::expr<
  1228. proto::tag::assign
  1229. , list2<expr const &, typename result_of::as_child<A>::type>
  1230. , 2
  1231. > that = {*this, proto::as_child(a)};
  1232. return that;
  1233. }
  1234. template<typename A>
  1235. BOOST_FORCEINLINE
  1236. proto::expr<
  1237. proto::tag::assign
  1238. , list2<expr const &, typename result_of::as_child<A const>::type>
  1239. , 2
  1240. > const
  1241. operator =(A const &a) const
  1242. {
  1243. proto::expr<
  1244. proto::tag::assign
  1245. , list2<expr const &, typename result_of::as_child<A const>::type>
  1246. , 2
  1247. > that = {*this, proto::as_child(a)};
  1248. return that;
  1249. }
  1250. template<typename A>
  1251. BOOST_FORCEINLINE
  1252. proto::expr<
  1253. proto::tag::subscript
  1254. , list2<expr const &, typename result_of::as_child<A>::type>
  1255. , 2
  1256. > const
  1257. operator [](A &a) const
  1258. {
  1259. proto::expr<
  1260. proto::tag::subscript
  1261. , list2<expr const &, typename result_of::as_child<A>::type>
  1262. , 2
  1263. > that = {*this, proto::as_child(a)};
  1264. return that;
  1265. }
  1266. template<typename A>
  1267. BOOST_FORCEINLINE
  1268. proto::expr<
  1269. proto::tag::subscript
  1270. , list2<expr const &, typename result_of::as_child<A const>::type>
  1271. , 2
  1272. > const
  1273. operator [](A const &a) const
  1274. {
  1275. proto::expr<
  1276. proto::tag::subscript
  1277. , list2<expr const &, typename result_of::as_child<A const>::type>
  1278. , 2
  1279. > that = {*this, proto::as_child(a)};
  1280. return that;
  1281. }
  1282. template<typename Sig>
  1283. struct result
  1284. {
  1285. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  1286. };
  1287. template<typename ...A>
  1288. BOOST_FORCEINLINE
  1289. typename result_of::funop<
  1290. expr const(A const &...)
  1291. , expr
  1292. , default_domain
  1293. >::type const
  1294. operator ()(A const &... a) const
  1295. {
  1296. return result_of::funop<
  1297. expr const(A const &...)
  1298. , expr
  1299. , default_domain
  1300. >::call(*this, a...);
  1301. }
  1302. };
  1303. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8>
  1304. struct expr<Tag, list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8>, 9 >
  1305. {
  1306. typedef Tag proto_tag;
  1307. static const long proto_arity_c = 9;
  1308. typedef mpl::long_<9 > proto_arity;
  1309. typedef expr proto_base_expr;
  1310. typedef list9<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8> proto_args;
  1311. typedef basic_expr<Tag, proto_args, 9 > proto_grammar;
  1312. typedef default_domain proto_domain;
  1313. typedef default_generator proto_generator;
  1314. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  1315. typedef expr proto_derived_expr;
  1316. typedef void proto_is_expr_;
  1317. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8;
  1318. typedef void proto_child9;
  1319. BOOST_FORCEINLINE
  1320. expr const &proto_base() const
  1321. {
  1322. return *this;
  1323. }
  1324. BOOST_FORCEINLINE
  1325. expr &proto_base()
  1326. {
  1327. return *this;
  1328. }
  1329. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8>
  1330. BOOST_FORCEINLINE
  1331. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8)
  1332. {
  1333. expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8};
  1334. return that;
  1335. }
  1336. typedef detail::not_a_valid_type address_of_hack_type_;
  1337. BOOST_FORCEINLINE
  1338. proto::expr<
  1339. proto::tag::assign
  1340. , list2<expr &, expr const &>
  1341. , 2
  1342. > const
  1343. operator =(expr const &a)
  1344. {
  1345. proto::expr<
  1346. proto::tag::assign
  1347. , list2<expr &, expr const &>
  1348. , 2
  1349. > that = {*this, a};
  1350. return that;
  1351. }
  1352. template<typename A>
  1353. BOOST_FORCEINLINE
  1354. proto::expr<
  1355. proto::tag::assign
  1356. , list2<expr const &, typename result_of::as_child<A>::type>
  1357. , 2
  1358. > const
  1359. operator =(A &a) const
  1360. {
  1361. proto::expr<
  1362. proto::tag::assign
  1363. , list2<expr const &, typename result_of::as_child<A>::type>
  1364. , 2
  1365. > that = {*this, proto::as_child(a)};
  1366. return that;
  1367. }
  1368. template<typename A>
  1369. BOOST_FORCEINLINE
  1370. proto::expr<
  1371. proto::tag::assign
  1372. , list2<expr const &, typename result_of::as_child<A const>::type>
  1373. , 2
  1374. > const
  1375. operator =(A const &a) const
  1376. {
  1377. proto::expr<
  1378. proto::tag::assign
  1379. , list2<expr const &, typename result_of::as_child<A const>::type>
  1380. , 2
  1381. > that = {*this, proto::as_child(a)};
  1382. return that;
  1383. }
  1384. template<typename A>
  1385. BOOST_FORCEINLINE
  1386. proto::expr<
  1387. proto::tag::subscript
  1388. , list2<expr const &, typename result_of::as_child<A>::type>
  1389. , 2
  1390. > const
  1391. operator [](A &a) const
  1392. {
  1393. proto::expr<
  1394. proto::tag::subscript
  1395. , list2<expr const &, typename result_of::as_child<A>::type>
  1396. , 2
  1397. > that = {*this, proto::as_child(a)};
  1398. return that;
  1399. }
  1400. template<typename A>
  1401. BOOST_FORCEINLINE
  1402. proto::expr<
  1403. proto::tag::subscript
  1404. , list2<expr const &, typename result_of::as_child<A const>::type>
  1405. , 2
  1406. > const
  1407. operator [](A const &a) const
  1408. {
  1409. proto::expr<
  1410. proto::tag::subscript
  1411. , list2<expr const &, typename result_of::as_child<A const>::type>
  1412. , 2
  1413. > that = {*this, proto::as_child(a)};
  1414. return that;
  1415. }
  1416. template<typename Sig>
  1417. struct result
  1418. {
  1419. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  1420. };
  1421. template<typename ...A>
  1422. BOOST_FORCEINLINE
  1423. typename result_of::funop<
  1424. expr const(A const &...)
  1425. , expr
  1426. , default_domain
  1427. >::type const
  1428. operator ()(A const &... a) const
  1429. {
  1430. return result_of::funop<
  1431. expr const(A const &...)
  1432. , expr
  1433. , default_domain
  1434. >::call(*this, a...);
  1435. }
  1436. };
  1437. template<typename Tag , typename Arg0 , typename Arg1 , typename Arg2 , typename Arg3 , typename Arg4 , typename Arg5 , typename Arg6 , typename Arg7 , typename Arg8 , typename Arg9>
  1438. struct expr<Tag, list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9>, 10 >
  1439. {
  1440. typedef Tag proto_tag;
  1441. static const long proto_arity_c = 10;
  1442. typedef mpl::long_<10 > proto_arity;
  1443. typedef expr proto_base_expr;
  1444. typedef list10<Arg0 , Arg1 , Arg2 , Arg3 , Arg4 , Arg5 , Arg6 , Arg7 , Arg8 , Arg9> proto_args;
  1445. typedef basic_expr<Tag, proto_args, 10 > proto_grammar;
  1446. typedef default_domain proto_domain;
  1447. typedef default_generator proto_generator;
  1448. typedef proto::tag::proto_expr<Tag, proto_domain> fusion_tag;
  1449. typedef expr proto_derived_expr;
  1450. typedef void proto_is_expr_;
  1451. typedef Arg0 proto_child0; proto_child0 child0; typedef Arg1 proto_child1; proto_child1 child1; typedef Arg2 proto_child2; proto_child2 child2; typedef Arg3 proto_child3; proto_child3 child3; typedef Arg4 proto_child4; proto_child4 child4; typedef Arg5 proto_child5; proto_child5 child5; typedef Arg6 proto_child6; proto_child6 child6; typedef Arg7 proto_child7; proto_child7 child7; typedef Arg8 proto_child8; proto_child8 child8; typedef Arg9 proto_child9; proto_child9 child9;
  1452. BOOST_FORCEINLINE
  1453. expr const &proto_base() const
  1454. {
  1455. return *this;
  1456. }
  1457. BOOST_FORCEINLINE
  1458. expr &proto_base()
  1459. {
  1460. return *this;
  1461. }
  1462. template<typename A0 , typename A1 , typename A2 , typename A3 , typename A4 , typename A5 , typename A6 , typename A7 , typename A8 , typename A9>
  1463. BOOST_FORCEINLINE
  1464. static expr const make(A0 const &a0 , A1 const &a1 , A2 const &a2 , A3 const &a3 , A4 const &a4 , A5 const &a5 , A6 const &a6 , A7 const &a7 , A8 const &a8 , A9 const &a9)
  1465. {
  1466. expr that = {a0 , a1 , a2 , a3 , a4 , a5 , a6 , a7 , a8 , a9};
  1467. return that;
  1468. }
  1469. typedef detail::not_a_valid_type address_of_hack_type_;
  1470. BOOST_FORCEINLINE
  1471. proto::expr<
  1472. proto::tag::assign
  1473. , list2<expr &, expr const &>
  1474. , 2
  1475. > const
  1476. operator =(expr const &a)
  1477. {
  1478. proto::expr<
  1479. proto::tag::assign
  1480. , list2<expr &, expr const &>
  1481. , 2
  1482. > that = {*this, a};
  1483. return that;
  1484. }
  1485. template<typename A>
  1486. BOOST_FORCEINLINE
  1487. proto::expr<
  1488. proto::tag::assign
  1489. , list2<expr const &, typename result_of::as_child<A>::type>
  1490. , 2
  1491. > const
  1492. operator =(A &a) const
  1493. {
  1494. proto::expr<
  1495. proto::tag::assign
  1496. , list2<expr const &, typename result_of::as_child<A>::type>
  1497. , 2
  1498. > that = {*this, proto::as_child(a)};
  1499. return that;
  1500. }
  1501. template<typename A>
  1502. BOOST_FORCEINLINE
  1503. proto::expr<
  1504. proto::tag::assign
  1505. , list2<expr const &, typename result_of::as_child<A const>::type>
  1506. , 2
  1507. > const
  1508. operator =(A const &a) const
  1509. {
  1510. proto::expr<
  1511. proto::tag::assign
  1512. , list2<expr const &, typename result_of::as_child<A const>::type>
  1513. , 2
  1514. > that = {*this, proto::as_child(a)};
  1515. return that;
  1516. }
  1517. template<typename A>
  1518. BOOST_FORCEINLINE
  1519. proto::expr<
  1520. proto::tag::subscript
  1521. , list2<expr const &, typename result_of::as_child<A>::type>
  1522. , 2
  1523. > const
  1524. operator [](A &a) const
  1525. {
  1526. proto::expr<
  1527. proto::tag::subscript
  1528. , list2<expr const &, typename result_of::as_child<A>::type>
  1529. , 2
  1530. > that = {*this, proto::as_child(a)};
  1531. return that;
  1532. }
  1533. template<typename A>
  1534. BOOST_FORCEINLINE
  1535. proto::expr<
  1536. proto::tag::subscript
  1537. , list2<expr const &, typename result_of::as_child<A const>::type>
  1538. , 2
  1539. > const
  1540. operator [](A const &a) const
  1541. {
  1542. proto::expr<
  1543. proto::tag::subscript
  1544. , list2<expr const &, typename result_of::as_child<A const>::type>
  1545. , 2
  1546. > that = {*this, proto::as_child(a)};
  1547. return that;
  1548. }
  1549. template<typename Sig>
  1550. struct result
  1551. {
  1552. typedef typename result_of::funop<Sig, expr, default_domain>::type const type;
  1553. };
  1554. template<typename ...A>
  1555. BOOST_FORCEINLINE
  1556. typename result_of::funop<
  1557. expr const(A const &...)
  1558. , expr
  1559. , default_domain
  1560. >::type const
  1561. operator ()(A const &... a) const
  1562. {
  1563. return result_of::funop<
  1564. expr const(A const &...)
  1565. , expr
  1566. , default_domain
  1567. >::call(*this, a...);
  1568. }
  1569. };