Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`exec::finally()` shouldn't include `std::exception_ptr` in the error types if neither the source or final senders include that error type

Đang mở
#1,335 3 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
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
cpp
Lĩnh vực
backend

Hướng nghiên cứu

Bắt đầu với reproducer được liên kết trong issue và kiểm tra exec/finally.hpp cùng với cách xử lý sender và kiểu lỗi trong stdexec/execution.hpp. Truy vết lý do let_error được khởi tạo với std::exception_ptr khi không có sender nào khai báo kiểu này. Hoàn thành khi ví dụ biên dịch được mà không có kiểu lỗi bổ sung đó và vẫn giữ nguyên hành vi của finally.

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

Mô tả

discussion

I would have expected the following code to compile, but it fails because let_error tries to instantiate a call to the lambda with an argument of type std::exception_ptr.

https://godbolt.org/z/PK8YjohW8

#include <stdexec/execution.hpp>
#include <exec/finally.hpp>

#include <cstdio>

struct X {
    X() : value(0) { std::puts("X::X()"); }
    X(X&& o) noexcept : value(o.value) { std::puts("X::X(X&&)"); }
    X(const X& o) noexcept : value(o.value)  { std::puts("X::X(const X&)"); }
    ~X() { std::puts("X::~X()"); value = -1; }
    int value;
};

int main() {
    auto result = stdexec::sync_wait(
        stdexec::let_error(
            exec::finally(
                stdexec::just_error(X{}),
                stdexec::just()),
            [](const X& x) noexcept {
                std::printf("caught X(value=%i)\n", x.value);
                return stdexec::just();
            }));
}

I suspect that this is because we don't know ahead of time whether connect() is potentially throwing.
We could potentially work around this by instead connecting the final-sender at connect-time of the finally sender. This way, we know that we will be able start the final-operation when the input operation completes regardless of whether the connect() method is throwing or not.

Ngôn ngữ chính
C++
Star
2.4k
Fork
270
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
43

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

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 NVIDIA/stdexec

Tất cả issue của NVIDIA/stdexec

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.