Constrain `protocol`'s constructors and converting assignment on constructibility of the stored type
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ó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 62/100
Hướng nghiên cứu
Start with the protocol value constructors, in-place constructors and converting assignment, and compare them with the polymorphic constructors, which already constrain on is_constructible_v. Add std::constructible_from constraints to the overloads the issue lists, and check that the converting assignment matches the change in #499. Done when the issue's static_asserts hold and protocol<MI> rejects MoveOnly at overload resolution instead of failing inside construct_at.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
protocol's value, in-place and converting-assignment overloads check conformance and the interface's special members, but not that the stored type can be constructed from the arguments. Type traits report them as available, and calling one fails inside the allocator:
struct I { int value() const; };
struct MI {
MI() = default;
MI(MI&&) = default;
MI(const MI&) = delete;
int value() const;
};
struct MoveOnly { std::unique_ptr<int> p; int value() const; };
struct Small { int v; int value() const; };
static_assert(std::is_constructible_v<xyz::protocol<MI>, MoveOnly&>);
static_assert(std::is_assignable_v<xyz::protocol<MI>&, MoveOnly&>);
static_assert(std::is_constructible_v<xyz::protocol<I>,
std::in_place_type_t<Small>, std::string>);
MoveOnly m;
xyz::protocol<MI> p(m); // error: no matching function for call to construct_at
Generic code that branches on these traits gets a hard error instead of the other branch.
polymorphic constrains its value constructor on is_constructible_v<UU, U> and its in-place constructors on is_constructible_v<U, Ts...>. Proposal: add std::constructible_from<TNorm, T> to the value constructors and the converting assignment (#499), and std::constructible_from<T, Args...> (plus the initializer_list form) to the in-place constructors.
- 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
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.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của jbcoe/cc-protocol
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jbcoe/cc-protocol#507 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
jbcoe/cc-protocol#455 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jbcoe/cc-protocol#407 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
jbcoe/cc-protocol#194 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
jbcoe/cc-protocol#513 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của jbcoe/cc-protocol
Issue tương tự
-
multilabel_margin_loss returns an unwritten scalar for an empty CPU batch with reduction='sum'Đang mởbot-triaged module: correctness (silent) module: cpu module: empty tensor module: loss triage review
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
stephenberry/glaze#3126 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Tests: parallel pyinstallcheck runs oversubscribe the machine through nested TBB and BLAS poolsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
CefRequestContext::ClearHttpCache crashes with a null callback, though the callback is optionalĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
chromiumembedded/cef#4376 ·
Maintainer thường phản hồi trong vòng 1 ngày