Skip to content

Commit 5c89f23

Browse files
authored
Switch to simpler construct_call() signature (#394)
1 parent cd55bdf commit 5c89f23

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

inst/include/cpp11/function.hpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,23 @@ class function {
3434
SEXP data_;
3535

3636
template <typename... Args>
37-
SEXP construct_call(SEXP val, const named_arg& arg, Args&&... args) const {
37+
void construct_call(SEXP val, const named_arg& arg, Args&&... args) const {
3838
SETCAR(val, arg.value());
3939
SET_TAG(val, safe[Rf_install](arg.name()));
4040
val = CDR(val);
41-
return construct_call(val, std::forward<Args>(args)...);
41+
construct_call(val, std::forward<Args>(args)...);
4242
}
4343

4444
// Construct the call recursively, each iteration adds an Arg to the pairlist.
45-
// We need
4645
template <typename T, typename... Args>
47-
SEXP construct_call(SEXP val, const T& arg, Args&&... args) const {
46+
void construct_call(SEXP val, const T& arg, Args&&... args) const {
4847
SETCAR(val, as_sexp(arg));
4948
val = CDR(val);
50-
return construct_call(val, std::forward<Args>(args)...);
49+
construct_call(val, std::forward<Args>(args)...);
5150
}
5251

5352
// Base case, just return
54-
SEXP construct_call(SEXP val) const { return val; }
53+
void construct_call(SEXP val) const {}
5554
};
5655

5756
class package {

0 commit comments

Comments
 (0)