Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

templ_meta.h

Go to the documentation of this file.
00001 /*
00002 *
00003 * templog library
00004 *
00005 * Copyright Hendrik Schober
00006 * Distributed under the Boost Software License, Version 1.0.
00007 *    (See accompanying file LICENSE_1_0.txt or copy at
00008 *     http://www.boost.org/LICENSE_1_0.txt)
00009 *
00010 * see http://templog.sourceforge.net/ for more info
00011 *
00012 */
00013 
00025 #if !defined(TEMPLOG_TEMPL_META_H)
00026 #define TEMPLOG_TEMPL_META_H
00027 
00028 /******************************************************************************/
00029 #include "config.h"
00030 
00031 /******************************************************************************/
00032 
00033 namespace templog {
00034 
00035     namespace templ_meta {
00036 
00040         struct nil {};
00041 
00045         template< bool B_ >
00046         struct boolean {
00047             typedef boolean<B_>                             result_type; 
00048             enum { result = B_ };
00049         };
00050 
00054         template< int I_ >
00055         struct int2type { enum { result = I_ }; };
00056 
00060         template< class Bool_, typename T1_, typename T2_ > struct if_;
00061         template<              typename T1_, typename T2_ > struct if_<boolean<true >,T1_,T2_> {typedef T1_ result_type;};
00062         template<              typename T1_, typename T2_ > struct if_<boolean<false>,T1_,T2_> {typedef T2_ result_type;};
00063 
00064     }
00065 
00066 }
00067 
00068 /******************************************************************************/
00069 
00070 #endif //defined(TEMPLOG_TEMPL_META_H)
00071 
00072 /******************************************************************************/
00073 /* EOF */

Generated on Sun Jan 11 15:57:20 2009 for templog library by  doxygen 1.4.2