proto_fwd.hpp 29 KB

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