/*============================================================================= Copyright (c) 2001-2007 Joel de Guzman 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_CORE_BASIC_ENVIRONMENT_HPP #define PHOENIX_CORE_BASIC_ENVIRONMENT_HPP #include #include #include #include #include #include #include #include #include namespace boost { namespace phoenix { template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( PHOENIX_ARG_LIMIT, typename T, fusion::void_)> class basic_environment { typedef mpl::BOOST_PP_CAT(vector, PHOENIX_ARG_LIMIT)< BOOST_PP_ENUM_PARAMS(PHOENIX_ARG_LIMIT, T)> args_with_void_type; public: // args_type: the list of types in an mpl::sequence typedef typename mpl::remove::type args_type; // tie_type: a fusion::tuple of references typedef typename fusion::result_of::as_vector< typename mpl::transform< args_type, boost::add_reference >::type >::type tie_type; basic_environment() : args_() {} template explicit basic_environment(U0& _0) : args_(_0) {} template basic_environment(U0& _0, U1& _1) : args_(_0, _1) {} // Bring in the rest of the constructors #include tie_type const& args() const { return args_; } tie_type& args() { return args_; } private: tie_type args_; }; }} #endif