1 /*==============================================================================
2 Copyright (c) 2001-2010 Joel de Guzman
3 Copyright (c) 2010 Thomas Heller
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #ifndef BOOST_PHOENIX_OBJECT_NEW_HPP
9 #define BOOST_PHOENIX_OBJECT_NEW_HPP
11 #include <boost/phoenix/core/limits.hpp>
12 #include <boost/phoenix/core/expression.hpp>
13 #include <boost/phoenix/core/meta_grammar.hpp>
14 #include <boost/phoenix/core/call.hpp>
15 #include <boost/phoenix/object/detail/target.hpp>
16 #include <boost/phoenix/support/iterate.hpp>
17 #include <boost/preprocessor/repetition/repeat_from_to.hpp>
19 #ifdef BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
20 # include <boost/phoenix/object/detail/cpp03/new_expr.hpp>
22 BOOST_PHOENIX_DEFINE_EXPRESSION_VARARG(
23 (boost)(phoenix)(new_)
24 , (proto::terminal<detail::target<proto::_> >)
30 namespace boost { namespace phoenix
34 template <typename Sig>
37 #if defined(BOOST_PHOENIX_NO_VARIADIC_OBJECT)
38 template <typename This, typename A0, typename Context>
39 struct result<This(A0, Context)>
41 typedef typename detail::result_of::target<A0> target_type;
42 typedef typename target_type::type * type;
45 template <typename Target, typename Context>
46 typename detail::result_of::target<Target>::type *
47 operator()(Target, Context const &) const
49 return new typename detail::result_of::target<Target>::type;
53 #include <boost/phoenix/object/detail/cpp03/new_eval.hpp>
59 template <typename Dummy>
60 struct default_actions::when<rule::new_, Dummy>
61 : call<new_eval, Dummy>
64 #if defined(BOOST_PHOENIX_NO_VARIADIC_OBJECT)
67 typename expression::new_<detail::target<T> >::type const
72 new_<detail::target<T> >::
73 make(detail::target<T>());
77 #include <boost/phoenix/object/detail/cpp03/new.hpp>