Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/boost/blank.hpp @ 47

Last change on this file since 47 was 29, checked in by landauf, 16 years ago

updated boost from 1_33_1 to 1_34_1

File size: 1.8 KB
Line 
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
26namespace boost {
27
28struct blank
29{
30};
31
32// type traits specializations
33//
34
35template <>
36struct is_pod< blank >
37    : mpl::true_
38{
39};
40
41template <>
42struct is_empty< blank >
43    : mpl::true_
44{
45};
46
47template <>
48struct is_stateless< blank >
49    : mpl::true_
50{
51};
52
53// relational operators
54//
55
56inline bool operator==(const blank&, const blank&)
57{
58    return true;
59}
60
61inline bool operator<=(const blank&, const blank&)
62{
63    return true;
64}
65
66inline bool operator>=(const blank&, const blank&)
67{
68    return true;
69}
70
71inline bool operator!=(const blank&, const blank&)
72{
73    return false;
74}
75
76inline bool operator<(const blank&, const blank&)
77{
78    return false;
79}
80
81inline bool operator>(const blank&, const blank&)
82{
83    return false;
84}
85
86// streaming support
87//
88BOOST_TEMPLATED_STREAM_TEMPLATE(E,T)
89inline 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
Note: See TracBrowser for help on using the repository browser.