1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/stdapis/boost/lambda/detail/actions.hpp Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,174 @@
1.4 +// -- Boost Lambda Library - actions.hpp ----------------------------------
1.5 +
1.6 +// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
1.7 +//
1.8 +// Distributed under the Boost Software License, Version 1.0. (See
1.9 +// accompanying file LICENSE_1_0.txt or copy at
1.10 +// http://www.boost.org/LICENSE_1_0.txt)
1.11 +
1.12 +// For more information, see www.boost.org
1.13 +
1.14 +// ----------------------------------------------------------------
1.15 +
1.16 +#ifndef BOOST_LAMBDA_ACTIONS_HPP
1.17 +#define BOOST_LAMBDA_ACTIONS_HPP
1.18 +
1.19 +namespace boost {
1.20 +namespace lambda {
1.21 +
1.22 +
1.23 +
1.24 +template<int Arity, class Act> class action;
1.25 +
1.26 +// these need to be defined here, since the corresponding lambda
1.27 +// functions are members of lambda_functor classes
1.28 +
1.29 +class assignment_action {};
1.30 +class subscript_action {};
1.31 +
1.32 +template <class Action> class other_action;
1.33 +
1.34 +// action for specifying the explicit return type
1.35 +template <class RET> class explicit_return_type_action {};
1.36 +
1.37 +// action for preventing the expansion of a lambda expression
1.38 +struct protect_action {};
1.39 +
1.40 + // must be defined here, comma is a special case
1.41 +struct comma_action {};
1.42 +
1.43 +
1.44 + // actions, for which the existence of protect is checked in return type
1.45 + // deduction.
1.46 +
1.47 +template <class Action> struct is_protectable {
1.48 + BOOST_STATIC_CONSTANT(bool, value = false);
1.49 +};
1.50 +
1.51 +// NOTE: comma action is protectable. Other protectable actions
1.52 +// are listed in operator_actions.hpp
1.53 +
1.54 +template<> struct is_protectable<other_action<comma_action> > {
1.55 + BOOST_STATIC_CONSTANT(bool, value = true);
1.56 +};
1.57 +
1.58 +
1.59 +namespace detail {
1.60 +
1.61 + // this type is used in return type deductions to signal that deduction
1.62 + // did not find a result. It does not necessarily mean an error, it commonly
1.63 + // means that something else should be tried.
1.64 + class unspecified {};
1.65 +}
1.66 +
1.67 + // function action is a special case: bind functions can be called with
1.68 + // the return type specialized explicitly e.g. bind<int>(foo);
1.69 + // If this call syntax is used, the return type is stored in the latter
1.70 + // argument of function_action template. Otherwise the argument gets the type
1.71 + // 'unspecified'.
1.72 + // This argument is only relevant in the return type deduction code
1.73 +template <int I, class Result_type = detail::unspecified>
1.74 +class function_action {};
1.75 +
1.76 +template<class T> class function_action<1, T> {
1.77 +public:
1.78 + template<class RET, class A1>
1.79 + static RET apply(A1& a1) {
1.80 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.81 + template apply<RET>(a1);
1.82 + }
1.83 +};
1.84 +
1.85 +template<class T> class function_action<2, T> {
1.86 +public:
1.87 + template<class RET, class A1, class A2>
1.88 + static RET apply(A1& a1, A2& a2) {
1.89 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.90 + template apply<RET>(a1, a2);
1.91 + }
1.92 +};
1.93 +
1.94 +template<class T> class function_action<3, T> {
1.95 +public:
1.96 + template<class RET, class A1, class A2, class A3>
1.97 + static RET apply(A1& a1, A2& a2, A3& a3) {
1.98 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.99 + template apply<RET>(a1, a2, a3);
1.100 + }
1.101 +};
1.102 +
1.103 +template<class T> class function_action<4, T> {
1.104 +public:
1.105 + template<class RET, class A1, class A2, class A3, class A4>
1.106 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
1.107 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.108 + template apply<RET>(a1, a2, a3, a4);
1.109 + }
1.110 +};
1.111 +
1.112 +template<class T> class function_action<5, T> {
1.113 +public:
1.114 + template<class RET, class A1, class A2, class A3, class A4, class A5>
1.115 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
1.116 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.117 + template apply<RET>(a1, a2, a3, a4, a5);
1.118 + }
1.119 +};
1.120 +
1.121 +template<class T> class function_action<6, T> {
1.122 +public:
1.123 + template<class RET, class A1, class A2, class A3, class A4, class A5,
1.124 + class A6>
1.125 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
1.126 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.127 + template apply<RET>(a1, a2, a3, a4, a5, a6);
1.128 + }
1.129 +};
1.130 +
1.131 +template<class T> class function_action<7, T> {
1.132 +public:
1.133 + template<class RET, class A1, class A2, class A3, class A4, class A5,
1.134 + class A6, class A7>
1.135 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
1.136 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.137 + template apply<RET>(a1, a2, a3, a4, a5, a6, a7);
1.138 + }
1.139 +};
1.140 +
1.141 +template<class T> class function_action<8, T> {
1.142 +public:
1.143 + template<class RET, class A1, class A2, class A3, class A4, class A5,
1.144 + class A6, class A7, class A8>
1.145 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
1.146 + A8& a8) {
1.147 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.148 + template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8);
1.149 + }
1.150 +};
1.151 +
1.152 +template<class T> class function_action<9, T> {
1.153 +public:
1.154 + template<class RET, class A1, class A2, class A3, class A4, class A5,
1.155 + class A6, class A7, class A8, class A9>
1.156 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
1.157 + A8& a8, A9& a9) {
1.158 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.159 + template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9);
1.160 + }
1.161 +};
1.162 +
1.163 +template<class T> class function_action<10, T> {
1.164 +public:
1.165 + template<class RET, class A1, class A2, class A3, class A4, class A5,
1.166 + class A6, class A7, class A8, class A9, class A10>
1.167 + static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
1.168 + A8& a8, A9& a9, A10& a10) {
1.169 + return function_adaptor<typename boost::remove_cv<A1>::type>::
1.170 + template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
1.171 + }
1.172 +};
1.173 +
1.174 +} // namespace lambda
1.175 +} // namespace boost
1.176 +
1.177 +#endif