PageRenderTime 21ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/contrib/boost/spirit/home/qi/detail/unused_skipper.hpp

http://pythonocc.googlecode.com/
C++ Header | 50 lines | 31 code | 9 blank | 10 comment | 0 complexity | 9e3a4aa57729038b0243d868f4727a5c MD5 | raw file
 1//  Copyright (c) 2001-2010 Hartmut Kaiser
 2//
 3//  Distributed under the Boost Software License, Version 1.0. (See accompanying
 4//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 5
 6#if !defined(BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM)
 7#define BOOST_SPIRIT_QI_UNUSED_SKIPPER_JUL_25_2009_0921AM
 8
 9#if defined(_MSC_VER)
10#pragma once
11#endif
12
13#include <boost/spirit/home/support/unused.hpp>
14
15namespace boost { namespace spirit { namespace qi { namespace detail
16{
17    template <typename Skipper>
18    struct unused_skipper : unused_type
19    {
20        unused_skipper(Skipper const& skipper)
21          : skipper(skipper) {}
22        Skipper const& skipper;
23
24    private:
25        // silence MSVC warning C4512: assignment operator could not be generated
26        unused_skipper& operator= (unused_skipper const&);
27    };
28
29    // If a surrounding lexeme[] directive was specified, the current
30    // skipper is of the type unused_skipper. In this case we 
31    // re-activate the skipper which was active before the skip[]
32    // directive.
33    template <typename Skipper>
34    inline Skipper const& 
35    get_skipper(unused_skipper<Skipper> const& u)
36    {
37        return u.skipper;
38    }
39
40    // If no surrounding lexeme[] directive was specified we keep what we got.
41    template <typename Skipper>
42    inline Skipper const& 
43    get_skipper(Skipper const& u)
44    {
45        return u;
46    }
47
48}}}}
49
50#endif