expr_variadic.hpp 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208
  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. };