| 1 | //----------------------------------------------------------------------------- |
|---|
| 2 | // boost blank.hpp header file |
|---|
| 3 | // See http://www.boost.org for updates, documentation, and revision history. |
|---|
| 4 | //----------------------------------------------------------------------------- |
|---|
| 5 | // |
|---|
| 6 | // Copyright (c) 2003 |
|---|
| 7 | // Eric Friedman |
|---|
| 8 | // |
|---|
| 9 | // Distributed under the Boost Software License, Version 1.0. (See |
|---|
| 10 | // accompanying file LICENSE_1_0.txt or copy at |
|---|
| 11 | // http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 12 | |
|---|
| 13 | #ifndef BOOST_BLANK_HPP |
|---|
| 14 | #define BOOST_BLANK_HPP |
|---|
| 15 | |
|---|
| 16 | #include "boost/blank_fwd.hpp" |
|---|
| 17 | |
|---|
| 18 | #include <iosfwd> // for std::basic_ostream forward declare |
|---|
| 19 | |
|---|
| 20 | #include "boost/detail/templated_streams.hpp" |
|---|
| 21 | #include "boost/mpl/bool.hpp" |
|---|
| 22 | #include "boost/type_traits/is_empty.hpp" |
|---|
| 23 | #include "boost/type_traits/is_pod.hpp" |
|---|
| 24 | #include "boost/type_traits/is_stateless.hpp" |
|---|
| 25 | |
|---|
| 26 | namespace boost { |
|---|
| 27 | |
|---|
| 28 | struct blank |
|---|
| 29 | { |
|---|
| 30 | }; |
|---|
| 31 | |
|---|
| 32 | // type traits specializations |
|---|
| 33 | // |
|---|
| 34 | |
|---|
| 35 | template <> |
|---|
| 36 | struct is_pod< blank > |
|---|
| 37 | : mpl::true_ |
|---|
| 38 | { |
|---|
| 39 | }; |
|---|
| 40 | |
|---|
| 41 | template <> |
|---|
| 42 | struct is_empty< blank > |
|---|
| 43 | : mpl::true_ |
|---|
| 44 | { |
|---|
| 45 | }; |
|---|
| 46 | |
|---|
| 47 | template <> |
|---|
| 48 | struct is_stateless< blank > |
|---|
| 49 | : mpl::true_ |
|---|
| 50 | { |
|---|
| 51 | }; |
|---|
| 52 | |
|---|
| 53 | // relational operators |
|---|
| 54 | // |
|---|
| 55 | |
|---|
| 56 | inline bool operator==(const blank&, const blank&) |
|---|
| 57 | { |
|---|
| 58 | return true; |
|---|
| 59 | } |
|---|
| 60 | |
|---|
| 61 | inline bool operator<=(const blank&, const blank&) |
|---|
| 62 | { |
|---|
| 63 | return true; |
|---|
| 64 | } |
|---|
| 65 | |
|---|
| 66 | inline bool operator>=(const blank&, const blank&) |
|---|
| 67 | { |
|---|
| 68 | return true; |
|---|
| 69 | } |
|---|
| 70 | |
|---|
| 71 | inline bool operator!=(const blank&, const blank&) |
|---|
| 72 | { |
|---|
| 73 | return false; |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | inline bool operator<(const blank&, const blank&) |
|---|
| 77 | { |
|---|
| 78 | return false; |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | inline bool operator>(const blank&, const blank&) |
|---|
| 82 | { |
|---|
| 83 | return false; |
|---|
| 84 | } |
|---|
| 85 | |
|---|
| 86 | // streaming support |
|---|
| 87 | // |
|---|
| 88 | BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) |
|---|
| 89 | inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( |
|---|
| 90 | BOOST_TEMPLATED_STREAM(ostream, E,T)& out |
|---|
| 91 | , const blank& |
|---|
| 92 | ) |
|---|
| 93 | { |
|---|
| 94 | // (output nothing) |
|---|
| 95 | return out; |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | } // namespace boost |
|---|
| 99 | |
|---|
| 100 | #endif // BOOST_BLANK_HPP |
|---|