]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/spirit/home/x3/support/unused.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / spirit / home / x3 / support / unused.hpp
1 /*=============================================================================
2 Copyright (c) 2001-2014 Joel de Guzman
3 Copyright (c) 2001-2011 Hartmut Kaiser
4
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #if !defined(BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM)
9 #define BOOST_SPIRIT_X3_UNUSED_APRIL_16_2006_0616PM
10
11 #include <iosfwd>
12
13 ///////////////////////////////////////////////////////////////////////////////
14 namespace boost { namespace spirit { namespace x3
15 {
16 struct unused_type
17 {
18 unused_type() = default;
19
20 template <typename T>
21 unused_type(T const&)
22 {
23 }
24
25 template <typename T>
26 unused_type const&
27 operator=(T const&) const
28 {
29 return *this;
30 }
31
32 template <typename T>
33 unused_type&
34 operator=(T const&)
35 {
36 return *this;
37 }
38
39 // unused_type can also masquerade as an empty context (see context.hpp)
40
41 template <typename ID>
42 unused_type get(ID) const
43 {
44 return {};
45 }
46 };
47
48 auto const unused = unused_type{};
49
50 inline std::ostream& operator<<(std::ostream& out, unused_type const&)
51 {
52 return out;
53 }
54
55 inline std::istream& operator>>(std::istream& in, unused_type&)
56 {
57 return in;
58 }
59 }}}
60
61 #endif