From 5c89f23ce48e8ded03a8fbe5fd1e4c125f72618a Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Mon, 26 Aug 2024 10:13:00 -0400 Subject: [PATCH] Switch to simpler `construct_call()` signature (#394) --- inst/include/cpp11/function.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/inst/include/cpp11/function.hpp b/inst/include/cpp11/function.hpp index c1679d97..a40c79b4 100644 --- a/inst/include/cpp11/function.hpp +++ b/inst/include/cpp11/function.hpp @@ -34,24 +34,23 @@ class function { SEXP data_; template - SEXP construct_call(SEXP val, const named_arg& arg, Args&&... args) const { + void construct_call(SEXP val, const named_arg& arg, Args&&... args) const { SETCAR(val, arg.value()); SET_TAG(val, safe[Rf_install](arg.name())); val = CDR(val); - return construct_call(val, std::forward(args)...); + construct_call(val, std::forward(args)...); } // Construct the call recursively, each iteration adds an Arg to the pairlist. - // We need template - SEXP construct_call(SEXP val, const T& arg, Args&&... args) const { + void construct_call(SEXP val, const T& arg, Args&&... args) const { SETCAR(val, as_sexp(arg)); val = CDR(val); - return construct_call(val, std::forward(args)...); + construct_call(val, std::forward(args)...); } // Base case, just return - SEXP construct_call(SEXP val) const { return val; } + void construct_call(SEXP val) const {} }; class package {