Fork me on GitHub

source: svn/trunk/Utilities/HepMC/interface/enable_if.h@ 930

Last change on this file since 930 was 349, checked in by severine ovyn, 16 years ago

first test

File size: 1.0 KB
RevLine 
[349]1#ifndef ENABLE_IF_H
2#define ENABLE_IF_H
3// author: Walter Brown
4
5// ----------------------------------------------------------------------
6// prolog
7
8namespace HepMC {
9namespace detail {
10
11
12// ----------------------------------------------------------------------
13// enable_if<>
14
15/// internal - used to decide if a class is arithmetic
16template< bool, class >
17struct enable_if
18{ };
19
20/// internal - use if class T is arithmetic
21template< class T >
22struct 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
32template< bool, class >
33struct disable_if
34{ };
35
36/// internal - used by SimpleVector to decide if a class is arithmetic
37template< class T >
38struct 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
Note: See TracBrowser for help on using the repository browser.