Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JCategory.hh
Go to the documentation of this file.
1 #ifndef __JLANG__JCATEGORY
2 #define __JLANG__JCATEGORY
3 
4 
5 /**
6  * \author mdejong
7  */
8 
9 namespace JLANG {}
10 namespace JPP { using namespace JLANG; }
11 
12 namespace JLANG {
13 
14  /**
15  * Auxiliary class to define value, reference and pointer types for given data type and category.
16  */
17  template<class T, bool is_modifiable>
18  struct JCategory;
19 
20  /**
21  * Specialisation of JCategory for modifiable (i.e. non-constant) data type.
22  */
23  template<class T>
24  struct JCategory<T, true> {
25  typedef T value_type;
26  typedef T& reference_type;
27  typedef T* pointer_type;
28  };
29 
30  /**
31  * Specialisation of JCategory for constant (i.e. non-modifiable) data type.
32  */
33  template<class T>
34  struct JCategory<T, false> {
35  typedef const T value_type;
36  typedef const T& reference_type;
37  typedef const T* pointer_type;
38  };
39 }
40 
41 #endif
Auxiliary class to define value, reference and pointer types for given data type and category...
Definition: JCategory.hh:18