Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Should the default `SEXP` in `r_vector` be a typed vector of length 0 rather than `R_NilValue`?

Aperta
#392 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, r
Ambito
backend

Direzione di ricerca

Start at r_vector's default construction and data_ handling, then inspect how default-constructed vectors currently behave when attributes are assigned. Evaluate the proposed typed, length-zero SEXP against the allocation and noexcept trade-offs, and validate that default construction supports attributes without requiring R_NilValue handling.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

i.e. to support things like https://github.com/r-lib/cpp11/issues/315 where you default construct the vector and immediately try and put attributes on it.

Would also simplify internal code that currently has to account for the possibility of R_NilValue as data_ quite a bit.

We'd have to write our own default constructor but I think that's totally possible?


A downside of this is that the default constructor would have to allocate and would no longer be noexcept or as "cheap", but I can't see that mattering much because you eventually allocate anyways?

Lingua principale
C++
Stelle
224
Fork
52
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di r-lib/cpp11

Tutte le issue di r-lib/cpp11

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.