stlab.adobe.com Adobe Systems Incorporated
empty.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2007 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 
7 /*************************************************************************************************/
8 
9 #ifndef ADOBE_EMPTY_HPP
10 #define ADOBE_EMPTY_HPP
11 
12 /*************************************************************************************************/
13 
14 #include <adobe/config.hpp>
15 
16 #include <boost/operators.hpp>
17 #include <boost/mpl/bool.hpp>
18 #include <boost/type_traits/is_empty.hpp>
19 #include <boost/type_traits/is_pod.hpp>
20 #include <boost/type_traits/has_trivial_constructor.hpp>
21 #include <boost/type_traits/has_trivial_destructor.hpp>
22 
23 #include <adobe/typeinfo.hpp>
24 
25 #if defined(ADOBE_STD_SERIALIZATION)
26 #include <iosfwd>
27 #endif
28 
29 /*************************************************************************************************/
30 
31 namespace adobe {
32 namespace version_1 {
33 
34 /*************************************************************************************************/
35 
49 struct empty_t : private boost::totally_ordered<empty_t>
50 {
51  friend inline bool operator == (const empty_t&, const empty_t&) { return true; }
52  friend inline bool operator < (const empty_t&, const empty_t&) { return false; }
53  friend inline void swap(empty_t&, empty_t&) { }
54 };
55 
56 #if defined(ADOBE_STD_SERIALIZATION)
57 std::ostream& operator << (std::ostream& stream, const empty_t&);
59 #endif
60 
61 /*************************************************************************************************/
62 
63 } // namespace version_1
64 
65 using version_1::empty_t;
66 
67 /*************************************************************************************************/
68 
74 template <typename Derived>
76 struct empty_base { };
77 
78 /*************************************************************************************************/
79 
80 } // namespace adobe
81 
82 /*************************************************************************************************/
83 
84 namespace boost {
85 
86 template <> struct is_pod<adobe::version_1::empty_t> : boost::mpl::true_ { };
87 template <> struct is_empty<adobe::version_1::empty_t> : boost::mpl::true_ { };
88 template <> struct has_trivial_constructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
89 template <> struct has_trivial_destructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
90 
91 }
92 
93 /*************************************************************************************************/
94 
95 ADOBE_NAME_TYPE_0("empty_t:version_1:adobe", adobe::version_1::empty_t)
96 ADOBE_SHORT_NAME_TYPE('e','m','t','y', adobe::version_1::empty_t)
97 
98 /*************************************************************************************************/
99 
100 #endif
101 
102 /*************************************************************************************************/
friend bool operator<(const empty_t &, const empty_t &)
Definition: empty.hpp:52
An empty regular- and less-than-comparable- type.
Definition: empty.hpp:49
friend void swap(empty_t &, empty_t &)
Definition: empty.hpp:53
std::ostream & operator<<(std::ostream &out, const dictionary_t &x)
#define ADOBE_SHORT_NAME_TYPE(a, b, c, d, T)
Definition: typeinfo.hpp:412
friend bool operator==(const empty_t &, const empty_t &)
Definition: empty.hpp:51

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google