Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#392 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp, r
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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?

Ngôn ngữ chính
C++
Star
224
Fork
52
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của r-lib/cpp11

Tất cả issue của r-lib/cpp11

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.