]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
3 | ||
4 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | ==============================================================================*/ | |
7 | #if !defined(BOOST_FUSION_SUPPORT_UNUSED_20070305_1038) | |
8 | #define BOOST_FUSION_SUPPORT_UNUSED_20070305_1038 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <iosfwd> | |
12 | ||
13 | #include <boost/config.hpp> | |
14 | #if defined(BOOST_MSVC) | |
15 | # pragma warning(push) | |
16 | # pragma warning(disable: 4522) // multiple assignment operators specified warning | |
17 | #endif | |
18 | ||
19 | #define BOOST_FUSION_UNUSED_HAS_IO | |
20 | ||
21 | namespace boost { namespace fusion | |
22 | { | |
23 | struct unused_type | |
24 | { | |
25 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
26 | unused_type() BOOST_NOEXCEPT | |
27 | { | |
28 | } | |
29 | ||
30 | template <typename T> | |
31 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
32 | unused_type(T const&) BOOST_NOEXCEPT | |
33 | { | |
34 | } | |
35 | ||
36 | template <typename T> | |
37 | BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED | |
38 | unused_type const& | |
39 | operator=(T const&) const BOOST_NOEXCEPT | |
40 | { | |
41 | return *this; | |
42 | } | |
43 | ||
44 | template <typename T> | |
45 | BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
46 | unused_type& | |
47 | operator=(T const&) BOOST_NOEXCEPT | |
48 | { | |
49 | return *this; | |
50 | } | |
51 | ||
52 | BOOST_FUSION_CONSTEXPR_THIS BOOST_FUSION_GPU_ENABLED | |
53 | unused_type const& | |
54 | operator=(unused_type const&) const BOOST_NOEXCEPT | |
55 | { | |
56 | return *this; | |
57 | } | |
58 | ||
59 | BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
60 | unused_type& | |
61 | operator=(unused_type const&) BOOST_NOEXCEPT | |
62 | { | |
63 | return *this; | |
64 | } | |
65 | }; | |
66 | ||
67 | BOOST_CONSTEXPR_OR_CONST unused_type unused = unused_type(); | |
68 | ||
69 | namespace detail | |
70 | { | |
71 | struct unused_only | |
72 | { | |
73 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
74 | unused_only(unused_type const&) BOOST_NOEXCEPT {} | |
75 | }; | |
76 | } | |
77 | ||
78 | BOOST_CONSTEXPR | |
79 | inline std::ostream& operator<<(std::ostream& out, detail::unused_only const&) BOOST_NOEXCEPT | |
80 | { | |
81 | return out; | |
82 | } | |
83 | ||
84 | BOOST_CONSTEXPR | |
85 | inline std::istream& operator>>(std::istream& in, unused_type&) BOOST_NOEXCEPT | |
86 | { | |
87 | return in; | |
88 | } | |
89 | }} | |
90 | ||
91 | #if defined(BOOST_MSVC) | |
92 | # pragma warning(pop) | |
93 | #endif | |
94 | ||
95 | #endif |