]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TEvtGen/HepMC/enable_if.h
Resolving the symbols in each library
[u/mrichter/AliRoot.git] / TEvtGen / HepMC / enable_if.h
1 #ifndef ENABLE_IF_H
2 #define ENABLE_IF_H
3 // author: Walter Brown
4
5 // ----------------------------------------------------------------------
6 // prolog
7
8 namespace HepMC  {
9 namespace detail {
10
11
12 // ----------------------------------------------------------------------
13 // enable_if<>
14
15 /// internal - used to decide if a class is arithmetic
16 template< bool, class >
17 struct enable_if
18 { };
19
20 /// internal - use if class T is arithmetic
21 template< class T >
22 struct enable_if<true, T>
23 {
24   typedef  T  type;     //!< check type of class T
25 };
26
27
28 // ----------------------------------------------------------------------
29 // disable_if<>
30
31 /// internal - used by SimpleVector to decide if a class is arithmetic
32 template< bool, class >
33 struct disable_if
34 { };
35
36 /// internal - used by SimpleVector to decide if a class is arithmetic
37 template< class T >
38 struct disable_if<false, T>
39 {
40   typedef  T  type;     //!< check type of class T
41 };
42
43
44 // ----------------------------------------------------------------------
45 // epilog
46
47 }  // namespace detail
48 }  // namespace HepMC
49
50 #endif  // ENABLE_IF_H