00001 // This is core/vpdl/vpdt/vpdt_enable_if.h 00002 #ifndef vpdt_enable_if_h_ 00003 #define vpdt_enable_if_h_ 00004 //: 00005 // \file 00006 // \author Matthew Leotta 00007 // \brief Use static booleans to control template instantiation 00008 // \date March 16, 2009 00009 // 00010 // These functions are borrow from Boost 00011 // 00012 // \verbatim 00013 // Modifications 00014 // None 00015 // \endverbatim 00016 00017 00018 00019 template <bool B, class T = void> 00020 struct vpdt_enable_if_c { 00021 typedef T type; 00022 }; 00023 00024 template <class T> 00025 struct vpdt_enable_if_c<false, T> {}; 00026 00027 template <class Cond, class T = void> 00028 struct vpdt_enable_if : public vpdt_enable_if_c<Cond::value, T> {}; 00029 00030 00031 template <bool B, class T = void> 00032 struct vpdt_disable_if_c { 00033 typedef T type; 00034 }; 00035 00036 template <class T> 00037 struct vpdt_disable_if_c<true, T> {}; 00038 00039 template <class Cond, class T = void> 00040 struct vpdt_disable_if : public vpdt_disable_if_c<Cond::value, T> {}; 00041 00042 00043 #endif // vpdt_enable_if_h_