operator_actions.hpp 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. // -- operator_actions.hpp - Boost Lambda Library ----------------------
  2. // Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See
  5. // accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // For more information, see http://lambda.cs.utu.fi
  8. #ifndef BOOST_LAMBDA_OPERATOR_ACTIONS_HPP
  9. #define BOOST_LAMBDA_OPERATOR_ACTIONS_HPP
  10. namespace boost {
  11. namespace lambda {
  12. // -- artihmetic ----------------------
  13. class plus_action {};
  14. class minus_action {};
  15. class multiply_action {};
  16. class divide_action {};
  17. class remainder_action {};
  18. // -- bitwise -------------------
  19. class leftshift_action {};
  20. class rightshift_action {};
  21. class xor_action {};
  22. // -- bitwise/logical -------------------
  23. class and_action {};
  24. class or_action {};
  25. class not_action {};
  26. // -- relational -------------------------
  27. class less_action {};
  28. class greater_action {};
  29. class lessorequal_action {};
  30. class greaterorequal_action {};
  31. class equal_action {};
  32. class notequal_action {};
  33. // -- increment/decrement ------------------------------
  34. class increment_action {};
  35. class decrement_action {};
  36. // -- void return ------------------------------
  37. // -- other ------------------------------
  38. class addressof_action {};
  39. // class comma_action {}; // defined in actions.hpp
  40. class contentsof_action {};
  41. // class member_pointer_action {}; (defined in member_ptr.hpp)
  42. // -- actioun group templates --------------------
  43. template <class Action> class arithmetic_action;
  44. template <class Action> class bitwise_action;
  45. template <class Action> class logical_action;
  46. template <class Action> class relational_action;
  47. template <class Action> class arithmetic_assignment_action;
  48. template <class Action> class bitwise_assignment_action;
  49. template <class Action> class unary_arithmetic_action;
  50. template <class Action> class pre_increment_decrement_action;
  51. template <class Action> class post_increment_decrement_action;
  52. // ---------------------------------------------------------
  53. // actions, for which the existence of protect is checked in return type
  54. // deduction.
  55. template <class Act> struct is_protectable<arithmetic_action<Act> > {
  56. BOOST_STATIC_CONSTANT(bool, value = true);
  57. };
  58. template <class Act> struct is_protectable<bitwise_action<Act> > {
  59. BOOST_STATIC_CONSTANT(bool, value = true);
  60. };
  61. template <class Act> struct is_protectable<logical_action<Act> > {
  62. BOOST_STATIC_CONSTANT(bool, value = true);
  63. };
  64. template <class Act> struct is_protectable<relational_action<Act> > {
  65. BOOST_STATIC_CONSTANT(bool, value = true);
  66. };
  67. template <class Act>
  68. struct is_protectable<arithmetic_assignment_action<Act> > {
  69. BOOST_STATIC_CONSTANT(bool, value = true);
  70. };
  71. template <class Act> struct is_protectable<bitwise_assignment_action<Act> > {
  72. BOOST_STATIC_CONSTANT(bool, value = true);
  73. };
  74. template <class Act> struct is_protectable<unary_arithmetic_action<Act> > {
  75. BOOST_STATIC_CONSTANT(bool, value = true);
  76. };
  77. template <class Act>
  78. struct is_protectable<pre_increment_decrement_action<Act> > {
  79. BOOST_STATIC_CONSTANT(bool, value = true);
  80. };
  81. template <class Act> struct
  82. is_protectable<post_increment_decrement_action<Act> > {
  83. BOOST_STATIC_CONSTANT(bool, value = true);
  84. };
  85. template <> struct is_protectable<other_action<addressof_action> > {
  86. BOOST_STATIC_CONSTANT(bool, value = true);
  87. };
  88. template <> struct is_protectable<other_action<contentsof_action> > {
  89. BOOST_STATIC_CONSTANT(bool, value = true);
  90. };
  91. template<> struct is_protectable<other_action<subscript_action> > {
  92. BOOST_STATIC_CONSTANT(bool, value = true);
  93. };
  94. template<> struct is_protectable<other_action<assignment_action> > {
  95. BOOST_STATIC_CONSTANT(bool, value = true);
  96. };
  97. // NOTE: comma action is also protectable, but the specialization is
  98. // in actions.hpp
  99. } // namespace lambda
  100. } // namespace boost
  101. #endif