proto_fwd.hpp 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file proto_fwd.hpp
  3. /// Forward declarations of all of proto's public types and functions.
  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. #ifndef BOOST_PROTO_FWD_HPP_EAN_04_01_2005
  9. #define BOOST_PROTO_FWD_HPP_EAN_04_01_2005
  10. #include <cstddef>
  11. #include <climits>
  12. #include <boost/config.hpp>
  13. #include <boost/detail/workaround.hpp>
  14. #include <boost/preprocessor/cat.hpp>
  15. #include <boost/preprocessor/arithmetic/inc.hpp>
  16. #include <boost/preprocessor/punctuation/comma.hpp>
  17. #include <boost/preprocessor/repetition/enum_params.hpp>
  18. #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
  19. #include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
  20. #include <boost/preprocessor/repetition/repeat_from_to.hpp>
  21. #include <boost/ref.hpp>
  22. #include <boost/mpl/long.hpp>
  23. #include <boost/type_traits/remove_const.hpp>
  24. #include <boost/type_traits/remove_reference.hpp>
  25. #include <boost/mpl/aux_/config/ttp.hpp>
  26. #include <boost/utility/result_of.hpp>
  27. #ifndef BOOST_PROTO_MAX_ARITY
  28. # define BOOST_PROTO_MAX_ARITY 10
  29. #endif
  30. #ifndef BOOST_PROTO_MAX_LOGICAL_ARITY
  31. # define BOOST_PROTO_MAX_LOGICAL_ARITY 10
  32. #endif
  33. #ifndef BOOST_PROTO_MAX_FUNCTION_CALL_ARITY
  34. # define BOOST_PROTO_MAX_FUNCTION_CALL_ARITY BOOST_PROTO_MAX_ARITY
  35. #endif
  36. #if BOOST_PROTO_MAX_ARITY < 3
  37. # error BOOST_PROTO_MAX_ARITY must be at least 3
  38. #endif
  39. #if BOOST_PROTO_MAX_FUNCTION_CALL_ARITY > BOOST_PROTO_MAX_ARITY
  40. # error BOOST_PROTO_MAX_FUNCTION_CALL_ARITY cannot be larger than BOOST_PROTO_MAX_ARITY
  41. #endif
  42. #ifndef BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
  43. #if 10 < BOOST_PROTO_MAX_ARITY || \
  44. 10 < BOOST_PROTO_MAX_LOGICAL_ARITY || \
  45. 10 < BOOST_PROTO_MAX_FUNCTION_CALL_ARITY
  46. #define BOOST_PROTO_DONT_USE_PREPROCESSED_FILES
  47. #endif
  48. #endif
  49. #ifndef BOOST_PROTO_BROKEN_CONST_OVERLOADS
  50. # if BOOST_WORKAROUND(__GNUC__, == 3) \
  51. || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(310))
  52. # define BOOST_PROTO_BROKEN_CONST_OVERLOADS
  53. # endif
  54. #endif
  55. #ifndef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
  56. # if BOOST_WORKAROUND(__GNUC__, == 3) \
  57. || BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(310))
  58. # define BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
  59. # endif
  60. #endif
  61. #ifdef BOOST_PROTO_BROKEN_CONST_OVERLOADS
  62. # include <boost/utility/enable_if.hpp>
  63. # include <boost/type_traits/is_const.hpp>
  64. # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)\
  65. , typename boost::disable_if_c<boost::is_const<T>::value, boost::proto::detail::undefined>::type * = 0
  66. #else
  67. # define BOOST_PROTO_DISABLE_IF_IS_CONST(T)
  68. #endif
  69. #ifdef BOOST_PROTO_BROKEN_CONST_QUALIFIED_FUNCTIONS
  70. # include <boost/utility/enable_if.hpp>
  71. # include <boost/type_traits/is_function.hpp>
  72. # define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)\
  73. , typename boost::disable_if_c<boost::is_function<T>::value, boost::proto::detail::undefined>::type * = 0
  74. #else
  75. # define BOOST_PROTO_DISABLE_IF_IS_FUNCTION(T)
  76. #endif
  77. #ifndef BOOST_PROTO_BROKEN_PTS
  78. # if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
  79. # define BOOST_PROTO_BROKEN_PTS
  80. # endif
  81. #endif
  82. #ifdef BOOST_NO_CXX11_DECLTYPE_N3276
  83. # // Proto can only use the decltype-based result_of if N3276 has been
  84. # // implemented by the compiler.
  85. # // See http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2011/n3276.pdf
  86. # ifndef BOOST_PROTO_USE_NORMAL_RESULT_OF
  87. # define BOOST_PROTO_USE_NORMAL_RESULT_OF
  88. # endif
  89. #endif
  90. // Unless compiler support is there, use tr1_result_of instead of
  91. // result_of to avoid the problems addressed by N3276.
  92. #ifdef BOOST_PROTO_USE_NORMAL_RESULT_OF
  93. # define BOOST_PROTO_RESULT_OF boost::result_of
  94. #else
  95. # define BOOST_PROTO_RESULT_OF boost::tr1_result_of
  96. #endif
  97. // If we're using the decltype-based result_of, we need to be a bit
  98. // stricter about the return types of some functions.
  99. #if defined(BOOST_RESULT_OF_USE_DECLTYPE) && defined(BOOST_PROTO_USE_NORMAL_RESULT_OF)
  100. # define BOOST_PROTO_STRICT_RESULT_OF
  101. # define BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(X, Y) X
  102. #else
  103. # define BOOST_PROTO_RETURN_TYPE_STRICT_LOOSE(X, Y) Y
  104. #endif
  105. #ifdef BOOST_MPL_CFG_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
  106. # define BOOST_PROTO_EXTENDED_TEMPLATE_PARAMETERS_MATCHING
  107. #endif
  108. #if defined(_MSC_VER)
  109. # define BOOST_PROTO_DISABLE_MSVC_C4180 __pragma(warning(disable : 4180)) // qualifier applied to function type has no meaning; ignored
  110. # define BOOST_PROTO_DISABLE_MSVC_C4522 __pragma(warning(disable : 4522)) // 'class' : multiple assignment operators specified
  111. # define BOOST_PROTO_DISABLE_MSVC_C4714 __pragma(warning(disable : 4714)) // function 'xxx' marked as __forceinline not inlined
  112. #else
  113. # define BOOST_PROTO_DISABLE_MSVC_C4180
  114. # define BOOST_PROTO_DISABLE_MSVC_C4522
  115. # define BOOST_PROTO_DISABLE_MSVC_C4714
  116. #endif
  117. namespace boost { namespace proto
  118. {
  119. namespace detail
  120. {
  121. typedef char yes_type;
  122. typedef char (&no_type)[2];
  123. template<int N>
  124. struct sized_type
  125. {
  126. typedef char (&type)[N];
  127. };
  128. struct dont_care;
  129. struct undefined; // leave this undefined
  130. struct not_a_valid_type;
  131. struct private_type_
  132. {
  133. private_type_ operator ,(int) const;
  134. };
  135. template<typename T>
  136. struct uncvref
  137. {
  138. typedef T type;
  139. };
  140. template<typename T>
  141. struct uncvref<T const>
  142. {
  143. typedef T type;
  144. };
  145. template<typename T>
  146. struct uncvref<T &>
  147. {
  148. typedef T type;
  149. };
  150. template<typename T>
  151. struct uncvref<T const &>
  152. {
  153. typedef T type;
  154. };
  155. template<typename T, std::size_t N>
  156. struct uncvref<T const[N]>
  157. {
  158. typedef T type[N];
  159. };
  160. template<typename T, std::size_t N>
  161. struct uncvref<T (&)[N]>
  162. {
  163. typedef T type[N];
  164. };
  165. template<typename T, std::size_t N>
  166. struct uncvref<T const (&)[N]>
  167. {
  168. typedef T type[N];
  169. };
  170. struct ignore
  171. {
  172. ignore()
  173. {}
  174. template<typename T>
  175. ignore(T const &)
  176. {}
  177. };
  178. /// INTERNAL ONLY
  179. ///
  180. #define BOOST_PROTO_UNCVREF(X) \
  181. typename boost::proto::detail::uncvref<X>::type \
  182. /**/
  183. struct _default;
  184. struct not_a_domain;
  185. struct not_a_grammar;
  186. struct not_a_generator;
  187. template<typename T, typename Void = void>
  188. struct is_transform_;
  189. template<typename T, typename Void = void>
  190. struct is_aggregate_;
  191. template<typename Expr>
  192. struct flat_view;
  193. }
  194. typedef detail::ignore const ignore;
  195. namespace argsns_
  196. {
  197. template<typename Arg0>
  198. struct term;
  199. #define M0(Z, N, DATA) \
  200. template<BOOST_PP_ENUM_PARAMS_Z(Z, N, typename Arg)> struct BOOST_PP_CAT(list, N); \
  201. /**/
  202. BOOST_PP_REPEAT_FROM_TO(1, BOOST_PP_INC(BOOST_PROTO_MAX_ARITY), M0, ~)
  203. #undef M0
  204. }
  205. using namespace argsns_;
  206. ///////////////////////////////////////////////////////////////////////////////
  207. // Operator tags
  208. namespace tagns_
  209. {
  210. namespace tag
  211. {
  212. struct terminal;
  213. struct unary_plus;
  214. struct negate;
  215. struct dereference;
  216. struct complement;
  217. struct address_of;
  218. struct logical_not;
  219. struct pre_inc;
  220. struct pre_dec;
  221. struct post_inc;
  222. struct post_dec;
  223. struct shift_left;
  224. struct shift_right;
  225. struct multiplies;
  226. struct divides;
  227. struct modulus;
  228. struct plus;
  229. struct minus;
  230. struct less;
  231. struct greater;
  232. struct less_equal;
  233. struct greater_equal;
  234. struct equal_to;
  235. struct not_equal_to;
  236. struct logical_or;
  237. struct logical_and;
  238. struct bitwise_and;
  239. struct bitwise_or;
  240. struct bitwise_xor;
  241. struct comma;
  242. struct mem_ptr;
  243. struct assign;
  244. struct shift_left_assign;
  245. struct shift_right_assign;
  246. struct multiplies_assign;
  247. struct divides_assign;
  248. struct modulus_assign;
  249. struct plus_assign;
  250. struct minus_assign;
  251. struct bitwise_and_assign;
  252. struct bitwise_or_assign;
  253. struct bitwise_xor_assign;
  254. struct subscript;
  255. struct member;
  256. struct if_else_;
  257. struct function;
  258. // Fusion tags
  259. template<typename Tag, typename Domain> struct proto_expr;
  260. template<typename Tag, typename Domain> struct proto_expr_iterator;
  261. template<typename Tag, typename Domain> struct proto_flat_view;
  262. }
  263. }
  264. using namespace tagns_;
  265. template<typename Expr>
  266. struct tag_of;
  267. ////////////////////////////////////////////////////////////////////////////////////////////////
  268. struct _;
  269. ////////////////////////////////////////////////////////////////////////////////////////////////
  270. struct default_generator;
  271. struct basic_default_generator;
  272. template<template<typename> class Extends>
  273. struct generator;
  274. template<template<typename> class Extends>
  275. struct pod_generator;
  276. struct by_value_generator;
  277. template<typename First, typename Second>
  278. struct compose_generators;
  279. template<typename Generator, typename Void = void>
  280. struct wants_basic_expr;
  281. template<typename Generator>
  282. struct use_basic_expr;
  283. ////////////////////////////////////////////////////////////////////////////////////////////////
  284. namespace domainns_
  285. {
  286. typedef detail::not_a_domain no_super_domain;
  287. template<
  288. typename Generator = default_generator
  289. , typename Grammar = proto::_
  290. , typename Super = no_super_domain
  291. >
  292. struct domain;
  293. struct default_domain;
  294. struct basic_default_domain;
  295. struct deduce_domain;
  296. template<typename Domain, typename Tag, typename Args, bool WantsBasicExpr = wants_basic_expr<typename Domain::proto_generator>::value>
  297. struct base_expr;
  298. }
  299. using namespace domainns_;
  300. ////////////////////////////////////////////////////////////////////////////////////////////////
  301. namespace exprns_
  302. {
  303. template<typename Tag, typename Args, long Arity = Args::arity>
  304. struct basic_expr;
  305. template<typename Tag, typename Args, long Arity = Args::arity>
  306. struct expr;
  307. template<
  308. typename Expr
  309. , typename Derived
  310. , typename Domain = default_domain
  311. , long Arity = Expr::proto_arity_c
  312. >
  313. struct extends;
  314. template<typename This, typename Fun, typename Domain>
  315. struct virtual_member;
  316. struct is_proto_expr;
  317. }
  318. ////////////////////////////////////////////////////////////////////////////////////////////////
  319. using exprns_::expr;
  320. using exprns_::basic_expr;
  321. using exprns_::extends;
  322. using exprns_::is_proto_expr;
  323. template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
  324. struct or_;
  325. template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_LOGICAL_ARITY, typename G, void)>
  326. struct and_;
  327. template<typename Grammar>
  328. struct not_;
  329. template<typename Condition, typename Then = _, typename Else = not_<_> >
  330. struct if_;
  331. template<typename Cases, typename Transform = tag_of<_>()>
  332. struct switch_;
  333. template<typename T>
  334. struct exact;
  335. template<typename T>
  336. struct convertible_to;
  337. template<typename Grammar>
  338. struct vararg;
  339. struct pack;
  340. // Boost bug https://svn.boost.org/trac/boost/ticket/4602
  341. //int const N = INT_MAX;
  342. int const N = (INT_MAX >> 10);
  343. namespace context
  344. {
  345. struct null_context;
  346. template<typename Expr, typename Context, long Arity = Expr::proto_arity_c>
  347. struct null_eval;
  348. struct default_context;
  349. template<typename Expr, typename Context, typename Tag = typename Expr::proto_tag, long Arity = Expr::proto_arity_c>
  350. struct default_eval;
  351. template<typename Derived, typename DefaultCtx = default_context>
  352. struct callable_context;
  353. template<typename Expr, typename Context, long Arity = Expr::proto_arity_c>
  354. struct callable_eval;
  355. }
  356. using context::null_context;
  357. using context::null_eval;
  358. using context::default_context;
  359. using context::default_eval;
  360. using context::callable_context;
  361. using context::callable_eval;
  362. namespace utility
  363. {
  364. template<typename T, typename Domain = default_domain>
  365. struct literal;
  366. }
  367. using utility::literal;
  368. namespace result_of
  369. {
  370. template<typename T, typename Domain = default_domain>
  371. struct as_expr;
  372. template<typename T, typename Domain = default_domain>
  373. struct as_child;
  374. template<typename Expr, typename N = mpl::long_<0> >
  375. struct child;
  376. template<typename Expr, long N>
  377. struct child_c;
  378. template<typename Expr>
  379. struct left;
  380. template<typename Expr>
  381. struct right;
  382. template<typename Expr>
  383. struct deep_copy;
  384. template<typename Expr, typename Context>
  385. struct eval;
  386. template<
  387. typename Tag
  388. , typename DomainOrA0
  389. BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(
  390. BOOST_PROTO_MAX_ARITY
  391. , typename A
  392. , = void BOOST_PP_INTERCEPT
  393. )
  394. , typename Void = void
  395. >
  396. struct make_expr;
  397. template<typename Tag, typename DomainOrSequence, typename SequenceOrVoid = void, typename Void = void>
  398. struct unpack_expr;
  399. template<typename T>
  400. struct as_env;
  401. template<typename Env, typename Tag>
  402. struct has_env_var;
  403. template<typename Env, typename Tag>
  404. struct env_var;
  405. }
  406. template<typename T, typename Void = void>
  407. struct is_expr;
  408. template<typename T, typename Void = void>
  409. struct is_domain;
  410. template<typename SubDomain, typename SuperDomain>
  411. struct is_sub_domain_of;
  412. template<typename T, typename Void = void>
  413. struct is_env;
  414. template<typename Expr>
  415. struct arity_of;
  416. template<typename T, typename Void = void>
  417. struct domain_of;
  418. template<typename Expr, typename Grammar>
  419. struct matches;
  420. // Generic expression metafunctions and
  421. // grammar elements
  422. template<typename Tag, typename Arg>
  423. struct unary_expr;
  424. template<typename Tag, typename Left, typename Right>
  425. struct binary_expr;
  426. template<typename Tag, BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
  427. struct nary_expr;
  428. // Specific expression metafunctions and
  429. // grammar elements, for convenience
  430. template<typename T> struct terminal;
  431. template<typename T> struct unary_plus;
  432. template<typename T> struct negate;
  433. template<typename T> struct dereference;
  434. template<typename T> struct complement;
  435. template<typename T> struct address_of;
  436. template<typename T> struct logical_not;
  437. template<typename T> struct pre_inc;
  438. template<typename T> struct pre_dec;
  439. template<typename T> struct post_inc;
  440. template<typename T> struct post_dec;
  441. template<typename T, typename U> struct shift_left;
  442. template<typename T, typename U> struct shift_right;
  443. template<typename T, typename U> struct multiplies;
  444. template<typename T, typename U> struct divides;
  445. template<typename T, typename U> struct modulus;
  446. template<typename T, typename U> struct plus;
  447. template<typename T, typename U> struct minus;
  448. template<typename T, typename U> struct less;
  449. template<typename T, typename U> struct greater;
  450. template<typename T, typename U> struct less_equal;
  451. template<typename T, typename U> struct greater_equal;
  452. template<typename T, typename U> struct equal_to;
  453. template<typename T, typename U> struct not_equal_to;
  454. template<typename T, typename U> struct logical_or;
  455. template<typename T, typename U> struct logical_and;
  456. template<typename T, typename U> struct bitwise_and;
  457. template<typename T, typename U> struct bitwise_or;
  458. template<typename T, typename U> struct bitwise_xor;
  459. template<typename T, typename U> struct comma;
  460. template<typename T, typename U> struct mem_ptr;
  461. template<typename T, typename U> struct assign;
  462. template<typename T, typename U> struct shift_left_assign;
  463. template<typename T, typename U> struct shift_right_assign;
  464. template<typename T, typename U> struct multiplies_assign;
  465. template<typename T, typename U> struct divides_assign;
  466. template<typename T, typename U> struct modulus_assign;
  467. template<typename T, typename U> struct plus_assign;
  468. template<typename T, typename U> struct minus_assign;
  469. template<typename T, typename U> struct bitwise_and_assign;
  470. template<typename T, typename U> struct bitwise_or_assign;
  471. template<typename T, typename U> struct bitwise_xor_assign;
  472. template<typename T, typename U> struct subscript;
  473. template<typename T, typename U> struct member;
  474. template<typename T, typename U, typename V> struct if_else_;
  475. template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(BOOST_PROTO_MAX_ARITY, typename A, void)>
  476. struct function;
  477. namespace functional
  478. {
  479. struct left;
  480. struct right;
  481. struct eval;
  482. struct deep_copy;
  483. template<typename Domain = default_domain>
  484. struct as_expr;
  485. template<typename Domain = default_domain>
  486. struct as_child;
  487. template<typename N = mpl::long_<0> >
  488. struct child;
  489. template<long N>
  490. struct child_c;
  491. struct as_env;
  492. template<typename Tag>
  493. struct has_env_var;
  494. template<typename Tag>
  495. struct env_var;
  496. template<typename Tag, typename Domain = deduce_domain>
  497. struct make_expr;
  498. template<typename Tag, typename Domain = deduce_domain>
  499. struct unpack_expr;
  500. typedef make_expr<tag::terminal> make_terminal;
  501. typedef make_expr<tag::unary_plus> make_unary_plus;
  502. typedef make_expr<tag::negate> make_negate;
  503. typedef make_expr<tag::dereference> make_dereference;
  504. typedef make_expr<tag::complement> make_complement;
  505. typedef make_expr<tag::address_of> make_address_of;
  506. typedef make_expr<tag::logical_not> make_logical_not;
  507. typedef make_expr<tag::pre_inc> make_pre_inc;
  508. typedef make_expr<tag::pre_dec> make_pre_dec;
  509. typedef make_expr<tag::post_inc> make_post_inc;
  510. typedef make_expr<tag::post_dec> make_post_dec;
  511. typedef make_expr<tag::shift_left> make_shift_left;
  512. typedef make_expr<tag::shift_right> make_shift_right;
  513. typedef make_expr<tag::multiplies> make_multiplies;
  514. typedef make_expr<tag::divides> make_divides;
  515. typedef make_expr<tag::modulus> make_modulus;
  516. typedef make_expr<tag::plus> make_plus;
  517. typedef make_expr<tag::minus> make_minus;
  518. typedef make_expr<tag::less> make_less;
  519. typedef make_expr<tag::greater> make_greater;
  520. typedef make_expr<tag::less_equal> make_less_equal;
  521. typedef make_expr<tag::greater_equal> make_greater_equal;
  522. typedef make_expr<tag::equal_to> make_equal_to;
  523. typedef make_expr<tag::not_equal_to> make_not_equal_to;
  524. typedef make_expr<tag::logical_or> make_logical_or;
  525. typedef make_expr<tag::logical_and> make_logical_and;
  526. typedef make_expr<tag::bitwise_and> make_bitwise_and;
  527. typedef make_expr<tag::bitwise_or> make_bitwise_or;
  528. typedef make_expr<tag::bitwise_xor> make_bitwise_xor;
  529. typedef make_expr<tag::comma> make_comma;
  530. typedef make_expr<tag::mem_ptr> make_mem_ptr;
  531. typedef make_expr<tag::assign> make_assign;
  532. typedef make_expr<tag::shift_left_assign> make_shift_left_assign;
  533. typedef make_expr<tag::shift_right_assign> make_shift_right_assign;
  534. typedef make_expr<tag::multiplies_assign> make_multiplies_assign;
  535. typedef make_expr<tag::divides_assign> make_divides_assign;
  536. typedef make_expr<tag::modulus_assign> make_modulus_assign;
  537. typedef make_expr<tag::plus_assign> make_plus_assign;
  538. typedef make_expr<tag::minus_assign> make_minus_assign;
  539. typedef make_expr<tag::bitwise_and_assign> make_bitwise_and_assign;
  540. typedef make_expr<tag::bitwise_or_assign> make_bitwise_or_assign;
  541. typedef make_expr<tag::bitwise_xor_assign> make_bitwise_xor_assign;
  542. typedef make_expr<tag::subscript> make_subscript;
  543. typedef make_expr<tag::if_else_> make_if_else;
  544. typedef make_expr<tag::function> make_function;
  545. struct flatten;
  546. struct make_pair;
  547. struct first;
  548. struct second;
  549. struct at;
  550. struct pop_front;
  551. struct push_front;
  552. struct pop_back;
  553. struct push_back;
  554. struct reverse;
  555. }
  556. typedef functional::flatten _flatten;
  557. typedef functional::make_pair _make_pair;
  558. typedef functional::first _first;
  559. typedef functional::second _second;
  560. typedef functional::at _at;
  561. typedef functional::pop_front _pop_front;
  562. typedef functional::push_front _push_front;
  563. typedef functional::pop_back _pop_back;
  564. typedef functional::push_back _push_back;
  565. typedef functional::reverse _reverse;
  566. typedef functional::eval _eval;
  567. struct _deep_copy;
  568. typedef functional::make_expr<tag::terminal> _make_terminal;
  569. typedef functional::make_expr<tag::unary_plus> _make_unary_plus;
  570. typedef functional::make_expr<tag::negate> _make_negate;
  571. typedef functional::make_expr<tag::dereference> _make_dereference;
  572. typedef functional::make_expr<tag::complement> _make_complement;
  573. typedef functional::make_expr<tag::address_of> _make_address_of;
  574. typedef functional::make_expr<tag::logical_not> _make_logical_not;
  575. typedef functional::make_expr<tag::pre_inc> _make_pre_inc;
  576. typedef functional::make_expr<tag::pre_dec> _make_pre_dec;
  577. typedef functional::make_expr<tag::post_inc> _make_post_inc;
  578. typedef functional::make_expr<tag::post_dec> _make_post_dec;
  579. typedef functional::make_expr<tag::shift_left> _make_shift_left;
  580. typedef functional::make_expr<tag::shift_right> _make_shift_right;
  581. typedef functional::make_expr<tag::multiplies> _make_multiplies;
  582. typedef functional::make_expr<tag::divides> _make_divides;
  583. typedef functional::make_expr<tag::modulus> _make_modulus;
  584. typedef functional::make_expr<tag::plus> _make_plus;
  585. typedef functional::make_expr<tag::minus> _make_minus;
  586. typedef functional::make_expr<tag::less> _make_less;
  587. typedef functional::make_expr<tag::greater> _make_greater;
  588. typedef functional::make_expr<tag::less_equal> _make_less_equal;
  589. typedef functional::make_expr<tag::greater_equal> _make_greater_equal;
  590. typedef functional::make_expr<tag::equal_to> _make_equal_to;
  591. typedef functional::make_expr<tag::not_equal_to> _make_not_equal_to;
  592. typedef functional::make_expr<tag::logical_or> _make_logical_or;
  593. typedef functional::make_expr<tag::logical_and> _make_logical_and;
  594. typedef functional::make_expr<tag::bitwise_and> _make_bitwise_and;
  595. typedef functional::make_expr<tag::bitwise_or> _make_bitwise_or;
  596. typedef functional::make_expr<tag::bitwise_xor> _make_bitwise_xor;
  597. typedef functional::make_expr<tag::comma> _make_comma;
  598. typedef functional::make_expr<tag::mem_ptr> _make_mem_ptr;
  599. typedef functional::make_expr<tag::assign> _make_assign;
  600. typedef functional::make_expr<tag::shift_left_assign> _make_shift_left_assign;
  601. typedef functional::make_expr<tag::shift_right_assign> _make_shift_right_assign;
  602. typedef functional::make_expr<tag::multiplies_assign> _make_multiplies_assign;
  603. typedef functional::make_expr<tag::divides_assign> _make_divides_assign;
  604. typedef functional::make_expr<tag::modulus_assign> _make_modulus_assign;
  605. typedef functional::make_expr<tag::plus_assign> _make_plus_assign;
  606. typedef functional::make_expr<tag::minus_assign> _make_minus_assign;
  607. typedef functional::make_expr<tag::bitwise_and_assign> _make_bitwise_and_assign;
  608. typedef functional::make_expr<tag::bitwise_or_assign> _make_bitwise_or_assign;
  609. typedef functional::make_expr<tag::bitwise_xor_assign> _make_bitwise_xor_assign;
  610. typedef functional::make_expr<tag::subscript> _make_subscript;
  611. typedef functional::make_expr<tag::if_else_> _make_if_else;
  612. typedef functional::make_expr<tag::function> _make_function;
  613. template<typename T>
  614. struct is_callable;
  615. template<typename T>
  616. struct is_transform;
  617. template<typename T>
  618. struct is_aggregate;
  619. #define BOOST_PROTO_UNEXPR() typedef int proto_is_expr_;
  620. #define BOOST_PROTO_CALLABLE() typedef void proto_is_callable_;
  621. #define BOOST_PROTO_AGGREGATE() typedef void proto_is_aggregate_;
  622. #define BOOST_PROTO_USE_BASIC_EXPR() typedef void proto_use_basic_expr_;
  623. struct callable
  624. {
  625. BOOST_PROTO_CALLABLE()
  626. };
  627. namespace envns_
  628. {
  629. struct key_not_found;
  630. struct empty_env;
  631. typedef int empty_state;
  632. template<typename Tag, typename Value, typename Base = empty_env>
  633. struct env;
  634. struct data_type;
  635. struct transforms_type;
  636. }
  637. using envns_::key_not_found;
  638. using envns_::empty_env;
  639. using envns_::empty_state;
  640. using envns_::env;
  641. using envns_::data_type;
  642. using envns_::transforms_type;
  643. struct external_transform;
  644. template<typename PrimitiveTransform = void, typename X = void>
  645. struct transform;
  646. template<typename Grammar, typename Fun = Grammar>
  647. struct when;
  648. template<typename Fun>
  649. struct otherwise;
  650. template<typename Fun>
  651. struct call;
  652. template<typename Fun>
  653. struct make;
  654. template<typename PrimitiveTransform>
  655. struct protect;
  656. template<typename T>
  657. struct noinvoke;
  658. template<typename Fun>
  659. struct lazy;
  660. template<typename Sequence, typename State, typename Fun>
  661. struct fold;
  662. template<typename Sequence, typename State, typename Fun>
  663. struct reverse_fold;
  664. // Q: can we replace fold_tree with fold<flatten(_), state, fun> ?
  665. // A: once segmented Fusion works well.
  666. template<typename Sequence, typename State, typename Fun>
  667. struct fold_tree;
  668. template<typename Sequence, typename State, typename Fun>
  669. struct reverse_fold_tree;
  670. template<typename Grammar, typename Domain = deduce_domain>
  671. struct pass_through;
  672. template<typename Grammar = detail::_default>
  673. struct _default;
  674. struct _expr;
  675. struct _state;
  676. struct _data;
  677. struct _value;
  678. struct _void;
  679. template<typename T, T I>
  680. struct integral_c;
  681. template<char I>
  682. struct char_;
  683. template<int I>
  684. struct int_;
  685. template<long I>
  686. struct long_;
  687. template<std::size_t I>
  688. struct size_t;
  689. template<int I>
  690. struct _child_c;
  691. typedef _child_c<0> _child0;
  692. typedef _child_c<1> _child1;
  693. typedef _child0 _child;
  694. typedef _child0 _left;
  695. typedef _child1 _right;
  696. // _child2, _child3, _child4, ...
  697. #define M0(Z, N, DATA) typedef _child_c<N> BOOST_PP_CAT(_child, N);
  698. BOOST_PP_REPEAT_FROM_TO(
  699. 2
  700. , BOOST_PP_DEC(BOOST_PROTO_MAX_ARITY)
  701. , M0
  702. , ~
  703. )
  704. #undef M0
  705. struct _byref;
  706. struct _byval;
  707. template<typename Tag>
  708. struct _env_var;
  709. struct _env;
  710. template<typename T>
  711. struct is_extension;
  712. namespace exops = exprns_;
  713. }} // namespace boost::proto
  714. #endif