Skip to content

Commit 172bd2b

Browse files
committed
make exec::finally pipeable again; fixes #1842
1 parent 76348c0 commit 172bd2b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

include/exec/finally.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
// include these after execution_fwd.hpp
2222
#include "../stdexec/__detail/__basic_sender.hpp"
2323
#include "../stdexec/__detail/__optional.hpp"
24+
#include "../stdexec/__detail/__sender_adaptor_closure.hpp"
2425
#include "../stdexec/__detail/__senders.hpp"
2526
#include "../stdexec/__detail/__tuple.hpp"
2627
#include "../stdexec/__detail/__utility.hpp"
@@ -48,7 +49,7 @@ namespace exec {
4849
template <STDEXEC::sender _Final>
4950
STDEXEC_ATTRIBUTE(always_inline)
5051
auto operator()(_Final&& __final) const {
51-
return __closure(*this, static_cast<_Final&&>(__final));
52+
return STDEXEC::__closure(*this, static_cast<_Final&&>(__final));
5253
}
5354

5455
template <class _Sender>

test/exec/test_finally.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ namespace {
2828
STATIC_REQUIRE(sender<decltype(s)>);
2929
}
3030

31+
TEST_CASE("finally with pipe syntax is a sender", "[adaptors][finally]") {
32+
auto s = just() | exec::finally(just());
33+
STATIC_REQUIRE(sender<decltype(s)>);
34+
}
35+
3136
TEST_CASE("finally is a sender in empty env", "[adaptors][finally]") {
3237
auto s = exec::finally(just(), just());
3338
STATIC_REQUIRE(sender_in<decltype(s), ex::env<>>);

0 commit comments

Comments
 (0)