Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/boost/spirit/home/qi/detail/unused_skipper.hpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //  Copyright (c) 2001-2011 Hartmut Kaiser
0002 //
0003 //  Distributed under the Boost Software License, Version 1.0. (See accompanying
0004 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #if !defined(BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM)
0007 #define BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM
0008 
0009 #if defined(_MSC_VER)
0010 #pragma once
0011 #endif
0012 
0013 #include <boost/spirit/home/support/unused.hpp>
0014 #include <boost/mpl/bool.hpp>
0015 
0016 namespace boost { namespace spirit { namespace qi { namespace detail
0017 {
0018 #ifdef _MSC_VER
0019 #  pragma warning(push)
0020 #  pragma warning(disable: 4512) // assignment operator could not be generated.
0021 #endif
0022     template <typename Skipper>
0023     struct unused_skipper : unused_type
0024     {
0025         unused_skipper(Skipper const& skipper_)
0026           : skipper(skipper_) {}
0027         Skipper const& skipper;
0028     };
0029 #ifdef _MSC_VER
0030 #  pragma warning(pop)
0031 #endif
0032 
0033     template <typename Skipper>
0034     struct is_unused_skipper
0035       : mpl::false_ {};
0036 
0037     template <typename Skipper>
0038     struct is_unused_skipper<unused_skipper<Skipper> >
0039       : mpl::true_ {};
0040 
0041     template <>
0042     struct is_unused_skipper<unused_type>
0043       : mpl::true_ {};
0044 
0045     // If a surrounding lexeme[] directive was specified, the current
0046     // skipper is of the type unused_skipper. In this case we
0047     // re-activate the skipper which was active before the skip[]
0048     // directive.
0049     template <typename Skipper>
0050     inline Skipper const&
0051     get_skipper(unused_skipper<Skipper> const& u)
0052     {
0053         return u.skipper;
0054     }
0055 
0056     // If no surrounding lexeme[] directive was specified we keep what we got.
0057     template <typename Skipper>
0058     inline Skipper const&
0059     get_skipper(Skipper const& u)
0060     {
0061         return u;
0062     }
0063 
0064 }}}}
0065 
0066 #endif