`exec::finally()` shouldn't include `std::exception_ptr` in the error types if neither the source or final senders include that error type
まだ誰も着手していません。
評価
調査の方向性
Issue にリンクされている reproducer から始め、stdexec/execution.hpp の sender とエラー型の処理と併せて exec/finally.hpp を調査します。どの sender も宣言していないにもかかわらず、なぜ let_error が std::exception_ptr でインスタンス化されるのかを追跡します。その追加のエラー型なしで例がコンパイルでき、finally の動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/stdexec のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 74/100
似ている issue
-
ai_reviewed
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ydb-platform/ydb#53869 · コメント 3 件 ·
-
bug cert blocker needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
conan-io/conan-center-index#31035 ·
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
vllm-project/vllm-ascend#17329 ·