any.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. #define M0(Z, N, DATA) any operator()(BOOST_PP_ENUM_PARAMS_Z(Z, N, any BOOST_PP_INTERCEPT));
  26. BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, ~)
  27. #undef M0
  28. template<typename T>
  29. operator T &() const volatile;
  30. any operator+();
  31. any operator-();
  32. any operator*();
  33. any operator&();
  34. any operator~();
  35. any operator!();
  36. any operator++();
  37. any operator--();
  38. any operator++(int);
  39. any operator--(int);
  40. friend any operator<<(any, any);
  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. };
  71. }
  72. using anyns::any;
  73. }
  74. }}
  75. #endif