-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathR.hpp
63 lines (50 loc) · 1.36 KB
/
R.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// cpp11 version: 0.4.7
// vendored on: 2024-05-26
#pragma once
#ifdef R_INTERNALS_H_
#if !(defined(R_NO_REMAP) && defined(STRICT_R_HEADERS))
#error R headers were included before cpp11 headers \
and at least one of R_NO_REMAP or STRICT_R_HEADERS \
was not defined.
#endif
#endif
#define R_NO_REMAP
#define STRICT_R_HEADERS
#include "Rinternals.h"
// clang-format off
#ifdef __clang__
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wattributes"
#endif
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wattributes"
#endif
// clang-format on
#include <type_traits>
#include "cpp11/altrep.hpp"
namespace cpp11 {
namespace literals {
constexpr R_xlen_t operator"" _xl(unsigned long long int value) { return value; }
} // namespace literals
namespace traits {
template <typename T>
struct get_underlying_type {
using type = T;
};
} // namespace traits
template <typename T>
inline T na();
template <typename T>
inline typename std::enable_if<!std::is_same<typename std::decay<T>::type, double>::value,
bool>::type
is_na(const T& value) {
return value == na<T>();
}
template <typename T>
inline typename std::enable_if<std::is_same<typename std::decay<T>::type, double>::value,
bool>::type
is_na(const T& value) {
return ISNA(value);
}
} // namespace cpp11