annotate DEPENDENCIES/generic/include/boost/spirit/home/qi/detail/unused_skipper.hpp @ 89:3c438d716e83

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