1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2008 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MATCHER_HPP_EAN_04_01_2007
9 #define BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MATCHER_HPP_EAN_04_01_2007
11 // MS compatible compilers support #pragma once
16 #include <boost/mpl/assert.hpp>
17 #include <boost/xpressive/detail/detail_fwd.hpp>
18 #include <boost/xpressive/detail/static/static.hpp>
20 namespace boost { namespace xpressive { namespace grammar_detail
22 struct as_matcher : proto::transform<as_matcher>
24 template<typename Expr, typename State, typename Data>
25 struct impl : proto::transform_impl<Expr, State, Data>
27 typedef typename impl::data data_type;
30 typename data_type::template apply<
31 typename proto::result_of::value<typename impl::expr>::type
35 result_type operator ()(
36 typename impl::expr_param expr
37 , typename impl::state_param
38 , typename impl::data_param data
41 return data.call(proto::value(expr));