EmptyType.h

00001 
00002 // The Loki Library
00003 // Copyright (c) 2001 by Andrei Alexandrescu
00004 // This code accompanies the book:
00005 // Alexandrescu, Andrei. "Modern C++ Design: Generic Programming and Design 
00006 //     Patterns Applied". Copyright (c) 2001. Addison-Wesley.
00007 // Permission to use, copy, modify, distribute and sell this software for any 
00008 //     purpose is hereby granted without fee, provided that the above copyright 
00009 //     notice appear in all copies and that both that copyright notice and this 
00010 //     permission notice appear in supporting documentation.
00011 // The author or Addison-Wesley Longman make no representations about the 
00012 //     suitability of this software for any purpose. It is provided "as is" 
00013 //     without express or implied warranty.
00015 #ifndef LOKI_EMPTYTYPE_INC_
00016 #define LOKI_EMPTYTYPE_INC_
00017 
00018 // $Id: EmptyType.h 751 2006-10-17 19:50:37Z syntheticpp $
00019 
00020 
00021 namespace Loki
00022 {
00024 // class EmptyType
00025 // Used as a class type that doesn't hold anything
00026 // Useful as a strawman class
00028 
00029     class EmptyType {};
00030     
00031     
00032     inline bool operator==(const EmptyType&, const EmptyType&)
00033     {
00034         return true;
00035     }   
00036 
00037     inline bool operator<(const EmptyType&, const EmptyType&)
00038     {
00039         return false;
00040     }
00041     
00042     inline bool operator>(const EmptyType&, const EmptyType&)
00043     {
00044         return false;
00045     }
00046 }
00047 
00048 #endif // end file guardian
00049 

Generated on Sun Feb 25 16:52:21 2007 for Loki by  doxygen 1.5.1-p1