Using span and string_view instead of raw pointers

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

Maintainer thường phản hồi trong vòng 3 ngày

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
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
backend-api-design

Hướng nghiên cứu

Bắt đầu bằng cách lập danh mục các API con trỏ-và-kích-thước trong các header được liệt kê: argparse.h, deepdata.h, imagebuf.h, imagebufalgo.h, imagecache.h, imageio.h, paramlist.h, strutil.h và texture.h. Xem xét vai trò API của từng lời gọi và quyết định xem lời gọi đó nên có thêm overload span/string_view hay thay thế dạng hiện có; được xem là hoàn tất khi các ứng viên thực tế đã được cập nhật với các quyết định tương thích nhất quán.

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

Mô tả

core APIs roadmap

This task is to scrub the major APIs and eliminate as many places (as is practical, we know some may be harder than others) where we have API calls that take a pointer and size (or worse -- just a pointer and an assumption about the size), and instead use span<T>/cspan<T> for things that are like arrays, and string_view for things that are like strings.

For calls falling into this category, we'll have to decide on a case-by-case basis whether to (a) add a new variety of the call that takes a span, deprecating the old one, (b) replace the old one entirely.

Just as a way to seed you with ideas, and since this work can be parallelized by different people taking different classes, here is a list of some headers that probably contain functions that could use this cleanup:

  • argparse.h
  • deepdata.h
  • imagebuf.h
  • imagebufalgo.h
  • imagecache.h
  • imageio.h
  • paramlist.h
  • strutil.h
  • texture.h
Ngôn ngữ chính
C++
Star
2.4k
Fork
727
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
67

Chuẩn bị môi trường

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 AcademySoftwareFoundation/OpenImageIO

Tất cả issue của AcademySoftwareFoundation/OpenImageIO

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.