Sacado Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sacado_mpl_enable_if.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Sacado Package
4 //
5 // Copyright 2006 NTESS and the Sacado contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef SACADO_MPL_ENABLE_IF_HPP
11 #define SACADO_MPL_ENABLE_IF_HPP
12 
13 namespace Sacado {
14 
15  namespace mpl {
16 
17  template <bool, typename T = void>
18  struct enable_if_c {};
19 
20  template <typename T>
21  struct enable_if_c<true, T> {
22  typedef T type;
23  };
24 
25  template <class Cond, typename T = void>
26  struct enable_if
27  : enable_if_c<Cond::value, T> {};
28 
29  template <bool, typename T = void>
30  struct lazy_enable_if_c {};
31 
32  template <typename T>
33  struct lazy_enable_if_c<true, T> {
34  typedef typename T::type type;
35  };
36 
37  template <class Cond, typename T = void>
39  : lazy_enable_if_c<Cond::value, T> {};
40 
41  }
42 
43 }
44 
45 #endif // SACADO_MPL_ENABLE_IF_HPP
expr true
#define T
Definition: Sacado_rad.hpp:553