Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:53:50

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // as_matcher.hpp
0003 //
0004 //  Copyright 2008 Eric Niebler. Distributed under the Boost
0005 //  Software License, Version 1.0. (See accompanying file
0006 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 
0008 #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MATCHER_HPP_EAN_04_01_2007
0009 #define BOOST_XPRESSIVE_DETAIL_STATIC_TRANSFORMS_AS_MATCHER_HPP_EAN_04_01_2007
0010 
0011 // MS compatible compilers support #pragma once
0012 #if defined(_MSC_VER)
0013 # pragma once
0014 #endif
0015 
0016 #include <boost/mpl/assert.hpp>
0017 #include <boost/xpressive/detail/detail_fwd.hpp>
0018 #include <boost/xpressive/detail/static/static.hpp>
0019 
0020 namespace boost { namespace xpressive { namespace grammar_detail
0021 {
0022     struct as_matcher : proto::transform<as_matcher>
0023     {
0024         template<typename Expr, typename State, typename Data>
0025         struct impl : proto::transform_impl<Expr, State, Data>
0026         {
0027             typedef typename impl::data data_type;
0028 
0029             typedef
0030                 typename data_type::template apply<
0031                     typename proto::result_of::value<typename impl::expr>::type
0032                 >::type
0033             result_type;
0034 
0035             result_type operator ()(
0036                 typename impl::expr_param expr
0037               , typename impl::state_param
0038               , typename impl::data_param data
0039             ) const
0040             {
0041                 return data.call(proto::value(expr));
0042             }
0043         };
0044     };
0045 
0046 }}}
0047 
0048 #endif