Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#1,335 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
backend

調査の方向性

Issue にリンクされている reproducer から始め、stdexec/execution.hpp の sender とエラー型の処理と併せて exec/finally.hpp を調査します。どの sender も宣言していないにもかかわらず、なぜ let_error が std::exception_ptr でインスタンス化されるのかを追跡します。その追加のエラー型なしで例がコンパイルでき、finally の動作が維持されれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
C++
スター
2.4k
フォーク
270
平均マージ
2日 17時間
マージ済み PR(30日)
37

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NVIDIA/stdexec のほかの issue

NVIDIA/stdexec の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。