2
0
mirror of https://github.com/boostorg/phoenix.git synced 2026-02-15 01:12:09 +00:00

fixed terminal.hpp

[SVN r69192]
This commit is contained in:
Thomas Heller
2011-02-23 00:23:48 +00:00
parent 3a0e3337e0
commit ae4a6caa06

View File

@@ -11,7 +11,6 @@
#include <boost/phoenix/core/limits.hpp>
#include <boost/is_placeholder.hpp>
#include <boost/phoenix/core/actor.hpp>
#include <boost/phoenix/core/as_actor.hpp>
#include <boost/phoenix/core/meta_grammar.hpp>
#include <boost/phoenix/core/terminal_fwd.hpp>
#include <boost/proto/matches.hpp>
@@ -108,64 +107,6 @@ namespace boost { namespace phoenix
)
>
{};
namespace meta
{
template<typename T>
struct const_ref
: add_reference<typename add_const<T>::type>
{};
template<typename T>
struct argument_type
: mpl::eval_if<
is_function<typename remove_pointer<T>::type>,
mpl::identity<T>,
const_ref<T> >
{
typedef T type;
};
}
template <typename T>
struct as_actor_base
{
typedef typename expression::terminal<T>::type type;
static typename expression::terminal<T>::type
convert(typename meta::argument_type<T>::type x)
{
return expression::terminal<T>::make(x);
}
};
// Sometimes it is necessary to auto-convert references to
// a value<T>. This happens when we are re-currying. This
// cannot happen through the standard public actor interfaces.
template <typename T>
struct as_actor_base<T&>
{
typedef typename expression::terminal<T>::type type;
static typename expression::terminal<T>::type
convert(T& x)
{
return expression::terminal<T>::make(x);
}
};
template <typename T, int N>
struct as_actor_base<T[N]>
{
typedef typename expression::terminal<T const *>::type type;
static typename expression::terminal<T const *>::type
convert(T const x[N])
{
return expression::terminal<T const *>::make(x);
}
};
}}
#endif