Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/spirit/home/x3/support/unused.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | f46d142149f5 |
children |
rev | line source |
---|---|
Chris@102 | 1 /*============================================================================= |
Chris@102 | 2 Copyright (c) 2001-2014 Joel de Guzman |
Chris@102 | 3 Copyright (c) 2001-2011 Hartmut Kaiser |
Chris@102 | 4 |
Chris@102 | 5 Distributed under the Boost Software License, Version 1.0. (See accompanying |
Chris@102 | 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
Chris@102 | 7 ==============================================================================*/ |
Chris@102 | 8 #if !defined(BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM) |
Chris@102 | 9 #define BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM |
Chris@102 | 10 |
Chris@102 | 11 #if defined(_MSC_VER) |
Chris@102 | 12 #pragma once |
Chris@102 | 13 #endif |
Chris@102 | 14 |
Chris@102 | 15 #include <ostream> |
Chris@102 | 16 #include <istream> |
Chris@102 | 17 #include <boost/mpl/identity.hpp> |
Chris@102 | 18 |
Chris@102 | 19 #if defined(BOOST_MSVC) |
Chris@102 | 20 # pragma warning(push) |
Chris@102 | 21 # pragma warning(disable: 4522) // multiple assignment operators specified warning |
Chris@102 | 22 #endif |
Chris@102 | 23 |
Chris@102 | 24 /////////////////////////////////////////////////////////////////////////////// |
Chris@102 | 25 namespace boost { namespace spirit { namespace x3 |
Chris@102 | 26 { |
Chris@102 | 27 struct unused_type |
Chris@102 | 28 { |
Chris@102 | 29 unused_type() |
Chris@102 | 30 { |
Chris@102 | 31 } |
Chris@102 | 32 |
Chris@102 | 33 template <typename T> |
Chris@102 | 34 unused_type(T const&) |
Chris@102 | 35 { |
Chris@102 | 36 } |
Chris@102 | 37 |
Chris@102 | 38 template <typename T> |
Chris@102 | 39 unused_type const& |
Chris@102 | 40 operator=(T const&) const |
Chris@102 | 41 { |
Chris@102 | 42 return *this; |
Chris@102 | 43 } |
Chris@102 | 44 |
Chris@102 | 45 template <typename T> |
Chris@102 | 46 unused_type& |
Chris@102 | 47 operator=(T const&) |
Chris@102 | 48 { |
Chris@102 | 49 return *this; |
Chris@102 | 50 } |
Chris@102 | 51 |
Chris@102 | 52 unused_type const& |
Chris@102 | 53 operator=(unused_type const&) const |
Chris@102 | 54 { |
Chris@102 | 55 return *this; |
Chris@102 | 56 } |
Chris@102 | 57 |
Chris@102 | 58 unused_type& |
Chris@102 | 59 operator=(unused_type const&) |
Chris@102 | 60 { |
Chris@102 | 61 return *this; |
Chris@102 | 62 } |
Chris@102 | 63 |
Chris@102 | 64 // unused_type can also masquerade as an empty context (see context.hpp) |
Chris@102 | 65 |
Chris@102 | 66 template <typename ID> |
Chris@102 | 67 struct get_result : mpl::identity<unused_type> {}; |
Chris@102 | 68 |
Chris@102 | 69 template <typename ID> |
Chris@102 | 70 unused_type get(ID) const |
Chris@102 | 71 { |
Chris@102 | 72 return unused_type(); |
Chris@102 | 73 } |
Chris@102 | 74 }; |
Chris@102 | 75 |
Chris@102 | 76 unused_type const unused = unused_type(); |
Chris@102 | 77 |
Chris@102 | 78 inline std::ostream& operator<<(std::ostream& out, unused_type const&) |
Chris@102 | 79 { |
Chris@102 | 80 return out; |
Chris@102 | 81 } |
Chris@102 | 82 |
Chris@102 | 83 inline std::istream& operator>>(std::istream& in, unused_type&) |
Chris@102 | 84 { |
Chris@102 | 85 return in; |
Chris@102 | 86 } |
Chris@102 | 87 }}} |
Chris@102 | 88 |
Chris@102 | 89 #if defined(BOOST_MSVC) |
Chris@102 | 90 # pragma warning(pop) |
Chris@102 | 91 #endif |
Chris@102 | 92 |
Chris@102 | 93 #endif |