Skip to content

Commit e5e89c5

Browse files
committed
added better detection of expected
1 parent 6cd55b2 commit e5e89c5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/intro-5-consumer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// examples/intro-1-hello-world.cpp -*-C++-*-
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
#ifndef __clang__
54
#include <beman/execution/execution.hpp>
65
#include <beman/execution/detail/suppress_push.hpp>
76
#include <expected>
@@ -10,6 +9,11 @@
109
#include <tuple>
1110
#include <cinttypes>
1211

12+
#if __cpp_lib_expected < 202202L
13+
int main() {
14+
std::cout << "this example needs a working std::expected\n";
15+
}
16+
#else
1317
namespace ex = ::beman::execution;
1418
using namespace std::string_literals;
1519

@@ -93,7 +97,4 @@ int main() {
9397
ex::then([](success) noexcept { std::cout << "success\n"; }) |
9498
ex::upon_error([](failure) noexcept { std::cout << "fail\n"; }));
9599
}
96-
#else
97-
int main() {
98-
}
99100
#endif

0 commit comments

Comments
 (0)