OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
types.hpp
1 /*
2  * types.hpp
3  *
4  * Created on: Jun 30, 2018
5  * Author: i-bird
6  */
7 
8 #ifndef TYPES_HPP_
9 #define TYPES_HPP_
10 
11 #include <boost/mpl/at.hpp>
12 #include <boost/mpl/size.hpp>
13 
14 //
15 // types.hpp - supply types that are needed by several headers
16 //
17 #include <cstddef>
18 
19 #ifdef MULTI_ARRAY_INT_INDEX
20 
21 namespace openfpm {
22 namespace detail {
23 namespace multi_array{
24 
25 // needed typedefs
26 typedef int size_type;
27 typedef int index;
28 
29 } // namespace multi_array
30 } // namespace detail
31 } // namespace openfpm
32 
33 #else
34 
35 
36 namespace openfpm {
37 namespace detail {
38 namespace multi_array{
39 
40 // needed typedefs
41 typedef std::size_t size_type;
42 typedef std::ptrdiff_t index;
43 
44 } // namespace multi_array
45 } // namespace detail
46 } // namespace openfpm
47 
48 #endif
49 
50 template<typename vector, unsigned int p, bool = (p < boost::mpl::size<vector>::type::value) >
51 struct at_impl
52 {
53  typedef boost::mpl::int_<0> type;
54 };
55 
56 template<typename vector, unsigned int p>
58 {
59  typedef boost::mpl::int_<boost::mpl::at<vector,boost::mpl::int_<p>>::type::value> type;
60 };
61 
62 #endif /* TYPES_HPP_ */
convert a type into constant type
Definition: aggregate.hpp:292
This class is a trick to indicate the compiler a specific specialization pattern.
Definition: memory_c.hpp:239