OpenFPM_data  0.1.0
Project that contain the implementation and interfaces for basic structure like vectors, grids, graph ... .
 All Data Structures Namespaces Functions Variables Typedefs Friends
mul_array_extents.hpp
1 /*
2  * mul_array_extents.hpp
3  *
4  * Created on: Dec 2, 2015
5  * Author: i-bird
6  */
7 
8 #ifndef OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_
9 #define OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_
10 
17 template<typename T>
19 {
20  static inline size_t mul()
21  {
22  return 1;
23  }
24 };
25 
32 template<typename T,size_t N1>
33 struct array_extents<T[N1]>
34 {
35  static inline size_t mul()
36  {
37  return N1;
38  }
39 };
40 
47 template<typename T,size_t N1,size_t N2>
48 struct array_extents<T[N1][N2]>
49 {
50  static inline size_t mul()
51  {
52  return N1 * N2;
53  }
54 };
55 
62 template<typename T,size_t N1,size_t N2,size_t N3>
63 struct array_extents<T[N1][N2][N3]>
64 {
65  static inline size_t mul()
66  {
67  return N1 * N2 * N3;
68  }
69 };
70 
71 
72 #endif /* OPENFPM_DATA_SRC_UTIL_MUL_ARRAY_EXTENTS_HPP_ */
Struct that give functionalities on array extensions.