[12] | 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 false; |
---|
| 64 | } |
---|
| 65 | |
---|
| 66 | // streaming support |
---|
| 67 | // |
---|
| 68 | BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) |
---|
| 69 | inline BOOST_TEMPLATED_STREAM(ostream, E,T)& operator<<( |
---|
| 70 | BOOST_TEMPLATED_STREAM(ostream, E,T)& out |
---|
| 71 | , const blank& |
---|
| 72 | ) |
---|
| 73 | { |
---|
| 74 | // (output nothing) |
---|
| 75 | return out; |
---|
| 76 | } |
---|
| 77 | |
---|
| 78 | } // namespace boost |
---|
| 79 | |
---|
| 80 | #endif // BOOST_BLANK_HPP |
---|