/*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2004 Daniel Wallin Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #ifndef PHOENIX_SCOPE_LOCAL_VARIABLE_HPP #define PHOENIX_SCOPE_LOCAL_VARIABLE_HPP #include #include #include #include #include namespace boost { namespace phoenix { template struct local_variable { typedef Key key_type; // This will prevent actor::operator()() from kicking in. // Actually, we do not need all actor::operator()s for // all arities, but this will suffice. The nullary // actor::operator() is particularly troublesome because // it is always eagerly evaluated by the compiler. typedef mpl::true_ no_nullary; template struct result : detail::apply_local, Env> {}; template typename result::type eval(Env const& env) const { typedef typename result::type return_type; typedef typename detail::get_index::type index_type; typedef detail::eval_local eval_local; return eval_local::template get( env , index_type()); } private: // silence MSVC warning C4512: assignment operator could not be generated local_variable& operator= (local_variable const&); }; namespace local_names { actor > const _a = local_variable(); actor > const _b = local_variable(); actor > const _c = local_variable(); actor > const _d = local_variable(); actor > const _e = local_variable(); actor > const _f = local_variable(); actor > const _g = local_variable(); actor > const _h = local_variable(); actor > const _i = local_variable(); actor > const _j = local_variable(); actor > const _k = local_variable(); actor > const _l = local_variable(); actor > const _m = local_variable(); actor > const _n = local_variable(); actor > const _o = local_variable(); actor > const _p = local_variable(); actor > const _q = local_variable(); actor > const _r = local_variable(); actor > const _s = local_variable(); actor > const _t = local_variable(); actor > const _u = local_variable(); actor > const _v = local_variable(); actor > const _w = local_variable(); actor > const _x = local_variable(); actor > const _y = local_variable(); actor > const _z = local_variable(); } }} #endif