Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // modifier.hpp Chris@16: // Chris@16: // Copyright 2008 Eric Niebler. Distributed under the Boost Chris@16: // Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_XPRESSIVE_DETAIL_STATIC_MODIFIER_HPP_EAN_10_04_2005 Chris@16: #define BOOST_XPRESSIVE_DETAIL_STATIC_MODIFIER_HPP_EAN_10_04_2005 Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: # pragma warning(push) Chris@16: # pragma warning(disable : 4510) // default constructor could not be generated Chris@16: # pragma warning(disable : 4610) // user defined constructor required Chris@16: #endif Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace xpressive { namespace detail Chris@16: { Chris@16: Chris@16: /////////////////////////////////////////////////////////////////////////////// Chris@16: // modifier Chris@16: template Chris@16: struct modifier_op Chris@16: { Chris@16: typedef regex_constants::syntax_option_type opt_type; Chris@16: Chris@16: template Chris@16: struct apply Chris@16: { Chris@16: typedef typename proto::binary_expr< Chris@16: modifier_tag Chris@16: , typename proto::terminal::type Chris@16: , typename proto::result_of::as_child::type Chris@16: >::type type; Chris@16: }; Chris@16: Chris@16: template Chris@16: typename apply::type const Chris@16: operator ()(Expr const &expr) const Chris@16: { Chris@16: typename apply::type that = {{this->mod_}, proto::as_child(expr)}; Chris@16: return that; Chris@16: } Chris@16: Chris@16: operator opt_type() const Chris@16: { Chris@16: return this->opt_; Chris@16: } Chris@16: Chris@16: Modifier mod_; Chris@16: opt_type opt_; Chris@16: }; Chris@16: Chris@16: }}} Chris@16: Chris@101: #if defined(_MSC_VER) Chris@16: # pragma warning(pop) Chris@16: #endif Chris@16: Chris@16: #endif