Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2026-03-27 Iñaki Ucar <iucar@fedoraproject.org>

* inst/include/Rcpp/vector/ListOf.h: Fix inheritance
* inst/include/Rcpp/proxy/NamesProxy.h: Fix compatibility

2026-03-26 Iñaki Ucar <iucar@fedoraproject.org>

* inst/include/Rcpp/internal/r_vector.h: Use dataptr() again to avoid an
Expand Down
21 changes: 5 additions & 16 deletions inst/include/Rcpp/proxy/NamesProxy.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand Down Expand Up @@ -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<SEXP> 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<SEXP> call(Rf_lang3(namesSym, parent, x));
Shield<SEXP> new_vec(Rcpp_fast_eval(call, R_GlobalEnv));
parent.set__(new_vec); // #nocov end
}

Rf_namesgets(parent, Shield<SEXP>(x));
}

} ;
Expand All @@ -74,7 +63,7 @@ class NamesProxyPolicy{
const CLASS& parent;

SEXP get() const {
return RCPP_GET_NAMES(parent.get__()) ;
return RCPP_GET_NAMES(parent) ;
}

} ;
Expand Down
9 changes: 5 additions & 4 deletions inst/include/Rcpp/vector/ListOf.h
Original file line number Diff line number Diff line change
@@ -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.
//
Expand All @@ -24,9 +25,9 @@ namespace Rcpp {

template <typename T>
class ListOf
: public NamesProxyPolicy<T>
, public AttributeProxyPolicy<T>
, public RObjectMethods<T>
: public NamesProxyPolicy<ListOf<T>>
, public AttributeProxyPolicy<ListOf<T>>
, public RObjectMethods<ListOf<T>>
{

public:
Expand Down
Loading