diff --git a/ChangeLog b/ChangeLog index a841bc970..74f9e0f09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2026-03-27 Iñaki Ucar + + * inst/include/Rcpp/vector/ListOf.h: Fix inheritance + * inst/include/Rcpp/proxy/NamesProxy.h: Fix compatibility + 2026-03-26 Dirk Eddelbuettel * inst/bib/Rcpp.bib: Refreshed a few more references diff --git a/inst/include/Rcpp/proxy/NamesProxy.h b/inst/include/Rcpp/proxy/NamesProxy.h index b87b4b0bb..e6f8d5e01 100644 --- a/inst/include/Rcpp/proxy/NamesProxy.h +++ b/inst/include/Rcpp/proxy/NamesProxy.h @@ -1,4 +1,5 @@ -// Copyright (C) 2013 Romain Francois +// Copyright (C) 2013 - 2025 Romain François +// Copyright (C) 2026 Romain François and Iñaki Ucar // // This file is part of Rcpp. // @@ -43,23 +44,11 @@ class NamesProxyPolicy{ CLASS& parent; SEXP get() const { - return RCPP_GET_NAMES(parent.get__()) ; + return RCPP_GET_NAMES(parent) ; } void set(SEXP x) { - Shield safe_x(x); - - /* check if we can use a fast version */ - if( TYPEOF(x) == STRSXP && parent.size() == Rf_length(x) ){ // #nocov start - Rf_namesgets(parent, x); - } else { - /* use the slower and more flexible version (callback to R) */ - SEXP namesSym = Rf_install( "names<-" ); - Shield call(Rf_lang3(namesSym, parent, x)); - Shield new_vec(Rcpp_fast_eval(call, R_GlobalEnv)); - parent.set__(new_vec); // #nocov end - } - + Rf_namesgets(parent, Shield(x)); } } ; @@ -74,7 +63,7 @@ class NamesProxyPolicy{ const CLASS& parent; SEXP get() const { - return RCPP_GET_NAMES(parent.get__()) ; + return RCPP_GET_NAMES(parent) ; } } ; diff --git a/inst/include/Rcpp/vector/ListOf.h b/inst/include/Rcpp/vector/ListOf.h index 7118195e9..46aed35c8 100644 --- a/inst/include/Rcpp/vector/ListOf.h +++ b/inst/include/Rcpp/vector/ListOf.h @@ -1,6 +1,7 @@ // ListOf.h: Rcpp R/C++ interface class library -- templated List container // -// Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois and Kevin Ushey +// Copyright (C) 2014 - 2025 Dirk Eddelbuettel, Romain François and Kevin Ushey +// Copyright (C) 2026 Dirk Eddelbuettel, Romain François, Kevin Ushey and Iñaki Ucar // // This file is part of Rcpp. // @@ -24,9 +25,9 @@ namespace Rcpp { template class ListOf - : public NamesProxyPolicy - , public AttributeProxyPolicy - , public RObjectMethods + : public NamesProxyPolicy> + , public AttributeProxyPolicy> + , public RObjectMethods> { public: