vpdt_enable_if.h
Go to the documentation of this file.
1 // This is core/vpdl/vpdt/vpdt_enable_if.h
2 #ifndef vpdt_enable_if_h_
3 #define vpdt_enable_if_h_
4 //:
5 // \file
6 // \author Matthew Leotta
7 // \brief Use static booleans to control template instantiation
8 // \date March 16, 2009
9 //
10 // These functions are borrow from Boost
11 //
12 // \verbatim
13 // Modifications
14 // None
15 // \endverbatim
16 
17 
18 
19 template <bool B, class T = void>
21  typedef T type;
22 };
23 
24 template <class T>
25 struct vpdt_enable_if_c<false, T> {};
26 
27 template <class Cond, class T = void>
28 struct vpdt_enable_if : public vpdt_enable_if_c<Cond::value, T> {};
29 
30 
31 template <bool B, class T = void>
33  typedef T type;
34 };
35 
36 template <class T>
37 struct vpdt_disable_if_c<true, T> {};
38 
39 template <class Cond, class T = void>
40 struct vpdt_disable_if : public vpdt_disable_if_c<Cond::value, T> {};
41 
42 
43 #endif // vpdt_enable_if_h_