if.h

Go to the documentation of this file.
00001 /* -*- C++ -*- ------------------------------------------------------------
00002  
00003 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
00004 
00005 The Configurable Math Library (CML) is distributed under the terms of the
00006 Boost Software License, v1.0 (see cml/LICENSE for details).
00007 
00008  *-----------------------------------------------------------------------*/
00013 #ifndef meta_if_h
00014 #define meta_if_h
00015 
00016 #include <cml/core/meta/common.h>
00017 
00018 namespace cml {
00019 
00021 template<bool yn, typename TrueT, typename FalseT> struct select_if;
00022 
00024 template<typename TrueT, typename FalseT>
00025 struct select_if<true,TrueT,FalseT> {
00026     typedef TrueT result;
00027     enum { is_true = true };
00028 };
00029 
00031 template<typename TrueT, typename FalseT>
00032 struct select_if<false,TrueT,FalseT> {
00033     typedef FalseT result;
00034     enum { is_true = false };
00035 };
00036 
00037 } // namespace cml
00038 
00039 #endif
00040 
00041 // -------------------------------------------------------------------------
00042 // vim:ft=cpp

Generated on Sat Jul 18 19:35:20 2009 for CML 1.0 by  doxygen 1.5.9