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 any operator[](any); 29 #define M0(Z, N, DATA) any operator()(BOOST_PP_ENUM_PARAMS_Z(Z, N, any BOOST_PP_INTERCEPT)); 30 BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, M0, ~) 31 #undef M0 32 33 template<typename T> 34 operator T &() const volatile; 35 36 any operator+(); 37 any operator-(); 38 any operator*(); 39 any operator&(); 40 any operator~(); 41 any operator!(); 42 any operator++(); 43 any operator--(); 44 any operator++(int); 45 any operator--(int); 46 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 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 friend any operator^=(any, any); 78 }; 79 } 80 81 using anyns::any; 82 } 83 }} 84 85 #endif 86