OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
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
21namespace openfpm {
22namespace detail {
23namespace multi_array{
24
25// needed typedefs
26typedef int size_type;
27typedef int index;
28
29} // namespace multi_array
30} // namespace detail
31} // namespace openfpm
32
33#else
34
35
36namespace openfpm {
37namespace detail {
38namespace multi_array{
39
40// needed typedefs
41typedef std::size_t size_type;
42typedef std::ptrdiff_t index;
43
44} // namespace multi_array
45} // namespace detail
46} // namespace openfpm
47
48#endif
49
50template<typename vector, unsigned int p, bool = (p < boost::mpl::size<vector>::type::value) >
51struct at_impl
52{
53 typedef boost::mpl::int_<0> type;
54};
55
56template<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_ */
This class is a trick to indicate the compiler a specific specialization pattern.
Definition memory_c.hpp:240
convert a type into constant type