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 9 #ifndef BOOST_PROTO_DETAIL_ANY_HPP_EAN_18_07_2012 10 #define BOOST_PROTO_DETAIL_ANY_HPP_EAN_18_07_2012 11 12 #include <boost/preprocessor/facilities/intercept.hpp> 13 #include <boost/preprocessor/repetition/repeat.hpp> 14 #include <boost/preprocessor/repetition/enum_params.hpp> 15 #include <boost/proto/proto_fwd.hpp> 16 17 namespace boost { namespace proto 18 { 19 namespace detail 20 { 21 namespace anyns 22 { 23 //////////////////////////////////////////////////////////////////////////////////////////// 24 struct any 25 { anyboost::proto::detail::anyns::any26 template<typename T> any(T const &) {} 27 any operator[](any); 28 #define M0(Z, N, DATA) any operator()(BOOST_PP_ENUM_PARAMS_Z(Z, N, any BOOST_PP_INTERCEPT)); 29 BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, ~) 30 #undef M0 31 32 template<typename T> 33 operator T &() const volatile; 34 35 any operator+(); 36 any operator-(); 37 any operator*(); 38 any operator&(); 39 any operator~(); 40 any operator!(); 41 any operator++(); 42 any operator--(); 43 any operator++(int); 44 any operator--(int); 45 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 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 friend any operator%=(any, any); 72 friend any operator+=(any, any); 73 friend any operator-=(any, any); 74 friend any operator&=(any, any); 75 friend any operator|=(any, any); 76 friend any operator^=(any, any); 77 }; 78 } 79 80 using anyns::any; 81 } 82 }} 83 84 #endif 85