Consider adding a compile-time assert like compile_assert P4021

Đang mở
#50 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
18/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
cpp
Lĩnh vực
devtools

Hướng nghiên cứu

The request is to add a compile_assert(expression, diagnostic_message) macro to Boost.Assert, modeled on the P4021R2 proposal linked in the issue. Start with the assertion headers in include/boost/assert.hpp and the existing static_assert wrappers, then check the library's test suite for how assertion behaviour is verified. Done means a design decision on the macro's semantics, implementation, and tests, which first requires maintainer agreement on whether the feature belongs in Boost at all.

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

Mô tả

Is this the right place to share this?

Would Boost Benefit from a compile-time assert like compile_assert()?

https://isocpp.org/files/papers/P4021R2.pdf

It's all at compile-time, there is no runtime behavior. Let's us check for non-const invariants, that otherwise would need a runtime assert.

compile_assert(expression, diagnostic_message);

Ngôn ngữ chính
C++
Star
34
Fork
79
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
1

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 boostorg/assert

Tất cả issue của boostorg/assert

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.