stlab.adobe.com Adobe Systems Incorporated

empty.hpp

Go to the documentation of this file.
00001 /*
00002     Copyright 2005-2007 Adobe Systems Incorporated
00003     Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
00004     or a copy at http://stlab.adobe.com/licenses.html)
00005 */
00006 
00007 /*************************************************************************************************/
00008 
00009 #ifndef ADOBE_EMPTY_HPP
00010 #define ADOBE_EMPTY_HPP
00011 
00012 /*************************************************************************************************/
00013 
00014 #include <adobe/config.hpp>
00015 
00016 #include <boost/operators.hpp>
00017 #include <boost/mpl/bool.hpp>
00018 #include <boost/type_traits/is_empty.hpp>
00019 #include <boost/type_traits/is_pod.hpp>
00020 #include <boost/type_traits/has_trivial_constructor.hpp>
00021 #include <boost/type_traits/has_trivial_destructor.hpp>
00022 
00023 #include <adobe/typeinfo.hpp>
00024 
00025 #if defined(ADOBE_STD_SERIALIZATION)
00026 #include <iosfwd>
00027 #endif
00028 
00029 /*************************************************************************************************/
00030 
00031 namespace adobe {
00032 namespace version_1 {
00033 
00034 /*************************************************************************************************/
00035 
00049 struct empty_t : private boost::totally_ordered<empty_t>
00050 {
00051     friend inline bool operator == (const empty_t&, const empty_t&) { return true; }
00052     friend inline bool operator < (const empty_t&, const empty_t&) { return false; }
00053     friend inline void swap(empty_t&, empty_t&) { }
00054 };
00055 
00056 #if defined(ADOBE_STD_SERIALIZATION)
00057 
00058 std::ostream& operator << (std::ostream& stream, const empty_t&);
00059 #endif
00060 
00061 /*************************************************************************************************/
00062 
00063 } // namespace version_1
00064 
00065 using version_1::empty_t;
00066 
00067 /*************************************************************************************************/
00068 
00074 
00075 template <typename Derived>
00076 struct empty_base { };
00077 
00078 /*************************************************************************************************/
00079 
00080 } // namespace adobe
00081 
00082 /*************************************************************************************************/
00083 
00084 namespace boost {
00085 
00086 template <> struct is_pod<adobe::version_1::empty_t> : boost::mpl::true_ { };
00087 template <> struct is_empty<adobe::version_1::empty_t> : boost::mpl::true_ { };
00088 template <> struct has_trivial_constructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
00089 template <> struct has_trivial_destructor<adobe::version_1::empty_t> : boost::mpl::true_ { };
00090 
00091 }
00092 
00093 /*************************************************************************************************/
00094 
00095 ADOBE_NAME_TYPE_0("empty_t:version_1:adobe", adobe::version_1::empty_t)
00096 ADOBE_SHORT_NAME_TYPE('e','m','t','y', adobe::version_1::empty_t)
00097 
00098 /*************************************************************************************************/
00099 
00100 #endif
00101 
00102 /*************************************************************************************************/

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