Skip to content

Commit

Permalink
Merge branch 'f-cpp11' into cran-1.0.0-1
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Jul 9, 2024
2 parents f7b518d + 6d2a4c2 commit c96d915
Show file tree
Hide file tree
Showing 24 changed files with 379 additions and 417 deletions.
4 changes: 2 additions & 2 deletions inst/include/cpp11.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// cpp11 version: 0.4.2
// vendored on: 2022-01-10
// cpp11 version: 0.4.7
// vendored on: 2024-06-26
#pragma once

#include "cpp11/R.hpp"
Expand Down
23 changes: 20 additions & 3 deletions inst/include/cpp11/R.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// cpp11 version: 0.4.2
// vendored on: 2022-01-10
// cpp11 version: 0.4.7
// vendored on: 2024-06-26
#pragma once

#ifdef R_INTERNALS_H_
Expand All @@ -26,6 +26,7 @@
#endif
// clang-format on

#include <type_traits>
#include "cpp11/altrep.hpp"

namespace cpp11 {
Expand All @@ -35,12 +36,28 @@ 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 bool is_na(const T& value) {
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
4 changes: 2 additions & 2 deletions inst/include/cpp11/altrep.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// cpp11 version: 0.4.2
// vendored on: 2022-01-10
// cpp11 version: 0.4.7
// vendored on: 2024-06-26
#pragma once

#include "Rversion.h"
Expand Down
Loading

0 comments on commit c96d915

Please sign in to comment.