Chris@16: // Copyright (c) 2001-2011 Hartmut Kaiser Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #if !defined(BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM) Chris@16: #define BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM Chris@16: Chris@16: #if defined(_MSC_VER) Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: #include Chris@101: #include Chris@16: Chris@16: namespace boost { namespace spirit { namespace qi { namespace detail Chris@16: { Chris@16: template Chris@16: struct unused_skipper : unused_type Chris@16: { Chris@16: unused_skipper(Skipper const& skipper_) Chris@16: : skipper(skipper_) {} Chris@16: Skipper const& skipper; Chris@16: Chris@16: private: Chris@16: // silence MSVC warning C4512: assignment operator could not be generated Chris@16: unused_skipper& operator= (unused_skipper const&); Chris@16: }; Chris@16: Chris@101: template Chris@101: struct is_unused_skipper Chris@101: : mpl::false_ {}; Chris@101: Chris@101: template Chris@101: struct is_unused_skipper > Chris@101: : mpl::true_ {}; Chris@101: Chris@101: template <> Chris@101: struct is_unused_skipper Chris@101: : mpl::true_ {}; Chris@101: Chris@16: // If a surrounding lexeme[] directive was specified, the current Chris@101: // skipper is of the type unused_skipper. In this case we Chris@16: // re-activate the skipper which was active before the skip[] Chris@16: // directive. Chris@16: template Chris@101: inline Skipper const& Chris@16: get_skipper(unused_skipper const& u) Chris@16: { Chris@16: return u.skipper; Chris@16: } Chris@16: Chris@16: // If no surrounding lexeme[] directive was specified we keep what we got. Chris@16: template Chris@101: inline Skipper const& Chris@16: get_skipper(Skipper const& u) Chris@16: { Chris@16: return u; Chris@16: } Chris@16: Chris@16: }}}} Chris@16: Chris@16: #endif