Skip to content

Commit b0b3f47

Browse files
committed
rollback noexcept
1 parent 4209cf0 commit b0b3f47

File tree

14 files changed

+42
-64
lines changed

14 files changed

+42
-64
lines changed

inst/include/cpp11/attribute_proxy.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class attribute_proxy {
4242
return *this;
4343
}
4444

45-
operator SEXP() const noexcept { return safe[Rf_getAttrib](parent_.data(), symbol_); }
45+
operator SEXP() const { return safe[Rf_getAttrib](parent_.data(), symbol_); }
4646
};
4747

4848
} // namespace cpp11

inst/include/cpp11/data_frame.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ class data_frame : public list {
3535
return R_NilValue;
3636
}
3737

38-
// @pachadotdev: + noexcept
39-
static R_xlen_t calc_nrow(SEXP x) noexcept {
38+
static R_xlen_t calc_nrow(SEXP x) {
4039
auto nms = get_attrib0(x, R_RowNamesSymbol);
4140
bool has_short_rownames =
4241
(Rf_isInteger(nms) && Rf_xlength(nms) == 2 && INTEGER(nms)[0] == NA_INTEGER);
@@ -59,8 +58,8 @@ class data_frame : public list {
5958
/* Adapted from
6059
* https://github.com/wch/r-source/blob/f2a0dfab3e26fb42b8b296fcba40cbdbdbec767d/src/main/attrib.c#L198-L207
6160
*/
62-
R_xlen_t nrow() const noexcept { return calc_nrow(*this); }
63-
R_xlen_t ncol() const noexcept { return size(); }
61+
R_xlen_t nrow() const { return calc_nrow(*this); }
62+
R_xlen_t ncol() const { return size(); }
6463
};
6564

6665
namespace writable {
@@ -90,16 +89,15 @@ class data_frame : public cpp11::data_frame {
9089
using cpp11::data_frame::ncol;
9190
using cpp11::data_frame::nrow;
9291

93-
// @pachadotdev: + noexcept
94-
attribute_proxy<data_frame> attr(const char* name) const noexcept const {
92+
attribute_proxy<data_frame> attr(const char* name) const const {
9593
return {*this, name};
9694
}
9795

98-
attribute_proxy<data_frame> attr(const std::string& name) const noexcept {
96+
attribute_proxy<data_frame> attr(const std::string& name) const {
9997
return {*this, name.c_str()};
10098
}
10199

102-
attribute_proxy<data_frame> attr(SEXP name) const noexcept { return {*this, name}; }
100+
attribute_proxy<data_frame> attr(SEXP name) const { return {*this, name}; }
103101

104102
attribute_proxy<data_frame> names() const { return {*this, R_NamesSymbol}; }
105103
};

inst/include/cpp11/doubles.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace cpp11 {
1717

1818
template <>
19-
inline constexpr SEXPTYPE r_vector<double>::get_sexptype() {
19+
inline SEXPTYPE r_vector<double>::get_sexptype() {
2020
return REALSXP;
2121
}
2222

inst/include/cpp11/environment.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,9 @@ class environment {
4848

4949
void remove(const char* name) { remove(safe[Rf_install](name)); }
5050

51-
// @pachadotdev: + noexcept
52-
R_xlen_t size() const noexcept { return Rf_xlength(env_); }
51+
R_xlen_t size() const { return Rf_xlength(env_); }
5352

54-
operator SEXP() const noexcept { return env_; }
53+
operator SEXP() const { return env_; }
5554
};
5655

5756
} // namespace cpp11

inst/include/cpp11/external_pointer.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212

1313
namespace cpp11 {
1414

15-
// @pachadotdev: + noexcept
1615
template <typename T>
17-
void default_deleter(T* obj) noexcept {
16+
void default_deleter(T* obj) {
1817
delete obj;
1918
}
2019

@@ -34,8 +33,7 @@ class external_pointer {
3433
return data;
3534
}
3635

37-
// @pachadotdev: + noexcept
38-
static void r_deleter(SEXP p) noexcept {
36+
static void r_deleter(SEXP p) {
3937
if (detail::r_typeof(p) != EXTPTRSXP) return;
4038

4139
T* ptr = static_cast<T*>(R_ExternalPtrAddr(p));

inst/include/cpp11/integers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
namespace cpp11 {
1818

1919
template <>
20-
inline constexpr SEXPTYPE r_vector<int>::get_sexptype() {
20+
inline SEXPTYPE r_vector<int>::get_sexptype() {
2121
return INTSXP;
2222
}
2323

inst/include/cpp11/list.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
namespace cpp11 {
1515

1616
template <>
17-
inline constexpr SEXPTYPE r_vector<SEXP>::get_sexptype() {
17+
inline SEXPTYPE r_vector<SEXP>::get_sexptype() {
1818
return VECSXP;
1919
}
2020

inst/include/cpp11/logicals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
namespace cpp11 {
1717

1818
template <>
19-
inline constexpr SEXPTYPE r_vector<r_bool>::get_sexptype() {
19+
inline SEXPTYPE r_vector<r_bool>::get_sexptype() {
2020
return LGLSXP;
2121
}
2222

inst/include/cpp11/matrix.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,9 @@ class matrix : public matrix_slices<S> {
184184

185185
SEXP data() const { return vector_.data(); }
186186

187-
// @pachadotdev: + noexcept
188-
R_xlen_t size() const noexcept { return vector_.size(); }
187+
R_xlen_t size() const { return vector_.size(); }
189188

190-
operator SEXP() const noexcept { return SEXP(vector_); }
189+
operator SEXP() const { return SEXP(vector_); }
191190

192191
// operator sexp() { return sexp(vector_); }
193192

inst/include/cpp11/named_arg.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
namespace cpp11 {
1212
class named_arg {
1313
public:
14-
// @pachadotdev: + noexcept
15-
explicit named_arg(const char* name) noexcept : name_(name), value_(R_NilValue) {}
14+
explicit named_arg(const char* name) : name_(name), value_(R_NilValue) {}
1615
named_arg& operator=(std::initializer_list<int> il) {
1716
value_ = as_sexp(il);
1817
return *this;
@@ -40,8 +39,7 @@ class named_arg {
4039

4140
namespace literals {
4241

43-
// @pachadotdev: + noexcept
44-
inline named_arg operator""_nm(const char* name, std::size_t) noexcept {
42+
inline named_arg operator""_nm(const char* name, std::size_t) {
4543
return named_arg(name);
4644
}
4745

0 commit comments

Comments
 (0)