A candidate's inherited member functions do not count toward conformance

Đang mở
#513 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
15/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
api

Hướng nghiên cứu

The decision is open: either collect member functions from accessible, unambiguous base classes or keep the current rule and document it. Start from members_of, which the issue says does not return base-class members, and from the xyz::protocol conformance check that rejects Derived. Done means a recorded decision, plus either base-class lookup that respects hiding and using-declarations or a diagnostic naming the base class. Confirm the direction with the maintainer before writing code.

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

Mô tả

A type conforms to an interface only through member functions it declares itself. One that inherits them does not conform:

struct Drawable { void draw() const; };
struct Base { void draw() const; };
struct Derived : Base {};

xyz::protocol<Drawable> p(std::in_place_type<Derived>);  // error

Candidates are enumerated with members_of, which does not return the members of a base class. Derived d; d.draw(); is valid, so a user would expect Derived to conform.

Decide whether to:

  1. walk the candidate's accessible, unambiguous bases when collecting member functions, honouring hiding and using-declarations, or
  2. keep the current rule and document it, with a diagnostic that says the member function was found in a base class.

Related: #511 (base classes of an interface), #512.

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

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

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 jbcoe/cc-protocol

Tất cả issue của jbcoe/cc-protocol

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.