Back to home page

EIC code displayed by LXR

 
 

    


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

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // modifier.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_MODIFIER_HPP_EAN_10_04_2005
0009 #define BOOST_XPRESSIVE_DETAIL_STATIC_MODIFIER_HPP_EAN_10_04_2005
0010 
0011 // MS compatible compilers support #pragma once
0012 #if defined(_MSC_VER)
0013 # pragma once
0014 # pragma warning(push)
0015 # pragma warning(disable : 4510) // default constructor could not be generated
0016 # pragma warning(disable : 4610) // user defined constructor required
0017 #endif
0018 
0019 #include <boost/xpressive/detail/detail_fwd.hpp>
0020 #include <boost/proto/traits.hpp>
0021 #include <boost/xpressive/regex_constants.hpp>
0022 
0023 namespace boost { namespace xpressive { namespace detail
0024 {
0025 
0026     ///////////////////////////////////////////////////////////////////////////////
0027     // modifier
0028     template<typename Modifier>
0029     struct modifier_op
0030     {
0031         typedef regex_constants::syntax_option_type opt_type;
0032 
0033         template<typename Expr>
0034         struct apply
0035         {
0036             typedef typename proto::binary_expr<
0037                 modifier_tag
0038               , typename proto::terminal<Modifier>::type
0039               , typename proto::result_of::as_child<Expr const>::type
0040             >::type type;
0041         };
0042 
0043         template<typename Expr>
0044         typename apply<Expr>::type const
0045         operator ()(Expr const &expr) const
0046         {
0047             typename apply<Expr>::type that = {{this->mod_}, proto::as_child(expr)};
0048             return that;
0049         }
0050 
0051         operator opt_type() const
0052         {
0053             return this->opt_;
0054         }
0055 
0056         Modifier mod_;
0057         opt_type opt_;
0058     };
0059 
0060 }}}
0061 
0062 #if defined(_MSC_VER)
0063 # pragma warning(pop)
0064 #endif
0065 
0066 #endif