any.hpp 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. ///////////////////////////////////////////////////////////////////////////////
  2. /// \file any.hpp
  3. /// Contains definition the detail::any type
  4. //
  5. // Copyright 2012 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_DETAIL_ANY_HPP_EAN_18_07_2012
  9. #define BOOST_PROTO_DETAIL_ANY_HPP_EAN_18_07_2012
  10. #include <boost/preprocessor/facilities/intercept.hpp>
  11. #include <boost/preprocessor/repetition/repeat.hpp>
  12. #include <boost/preprocessor/repetition/enum_params.hpp>
  13. #include <boost/proto/proto_fwd.hpp>
  14. namespace boost { namespace proto
  15. {
  16. namespace detail
  17. {
  18. namespace anyns
  19. {
  20. ////////////////////////////////////////////////////////////////////////////////////////////
  21. struct any
  22. {
  23. template<typename T> any(T const &) {}
  24. any operator=(any);
  25. any operator[](any);
  26. #define M0(Z, N, DATA) any operator()(BOOST_PP_ENUM_PARAMS_Z(Z, N, any BOOST_PP_INTERCEPT));
  27. BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, ~)
  28. #undef M0
  29. template<typename T>
  30. operator T &() const volatile;
  31. any operator+();
  32. any operator-();
  33. any operator*();
  34. any operator&();
  35. any operator~();
  36. any operator!();
  37. any operator++();
  38. any operator--();
  39. any operator++(int);
  40. any operator--(int);
  41. friend any operator<<(any, any);
  42. friend any operator>>(any, any);
  43. friend any operator*(any, any);
  44. friend any operator/(any, any);
  45. friend any operator%(any, any);
  46. friend any operator+(any, any);
  47. friend any operator-(any, any);
  48. friend any operator<(any, any);
  49. friend any operator>(any, any);
  50. friend any operator<=(any, any);
  51. friend any operator>=(any, any);
  52. friend any operator==(any, any);
  53. friend any operator!=(any, any);
  54. friend any operator||(any, any);
  55. friend any operator&&(any, any);
  56. friend any operator&(any, any);
  57. friend any operator|(any, any);
  58. friend any operator^(any, any);
  59. friend any operator,(any, any);
  60. friend any operator->*(any, any);
  61. friend any operator<<=(any, any);
  62. friend any operator>>=(any, any);
  63. friend any operator*=(any, any);
  64. friend any operator/=(any, any);
  65. friend any operator%=(any, any);
  66. friend any operator+=(any, any);
  67. friend any operator-=(any, any);
  68. friend any operator&=(any, any);
  69. friend any operator|=(any, any);
  70. friend any operator^=(any, any);
  71. };
  72. }
  73. using anyns::any;
  74. }
  75. }}
  76. #endif