static validation of closed overrider sets

Đang mở
#137 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 1 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
35/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
compilers

Hướng nghiên cứu

Start by reading the BOOST_OPENMETHOD interface and the project’s compile-time dispatch and ambiguity-checking code; the issue provides no file or test names. Determine how a declared set of overriders could be checked for missing or ambiguous virtual tuples while allowing later specializations, then add coverage for those cases. Done means the compile-time guarantee works for the declared set and the documented limitation for later specializations is clear.

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

Mô tả

enhancement explore

Inspired by https://github.com/Boumg/mini-openmethod.

Many reasonable applications of open-methods require only semi-openness, i.e. the ability to add polymorphic behavior to existing class hierarchies, without the need to specialize existing methods. In that case, the method could optionally specify a set of overriders, which would be checked at compile time for missing or ambiguous virtual tuples. The mechanism could naturally extend BOOST_OPENMETHOD:

BOOST_OPENMETHOD(
    poke, (virtual_ptr<Animal>, std::ostream& os), void,
    [](virtual_ptr<Cat>, std::ostream& os) {
        os << "hiss";
    },
    [](virtual_ptr<Dog>, std::ostream& os) {
        os << "bark";
    }
);

User would retain the ability to add specializations afterwards, but then the compile time guarantee would be off.

Ngôn ngữ chính
C++
Star
14
Fork
7
Merge trung bình
3 ngày 3 giờ
Pull request đã merge (30 ngày)
15

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/openmethod

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

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.