Skip to content

Commit

Permalink
fixed formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarkuehl committed Jan 26, 2025
1 parent 450d235 commit 8d11524
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion resources.md → docs/resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This page has links to some resources related to this repository:

* Lewis Baker's [Asymmetric Transfer blog](https://lewissbaker.github.io/)
* Lewis Baker's [Asymmetric Transfer blog](https://lewissbaker.github.io/)
* Dietmar Kühl's
[co_await All The Things](https://youtu.be/Npiw4cYElng?si=J0EYX6IgBf_u-e6z)
from [ACCU 2023](https://accu.org/conf-previous/2023/sessions/) implementing
Expand Down
6 changes: 3 additions & 3 deletions examples/stop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ int main() {

struct context {
struct xstop_source_type { // remove the x to disable the stop token
static constexpr bool stop_possible() { return false; }
static constexpr void request_stop() {}
static constexpr beman::execution::never_stop_token get_token() { return {}; }
static constexpr bool stop_possible() { return false; }
static constexpr void request_stop() {}
static constexpr beman::execution::never_stop_token get_token() { return {}; }
};
};

Expand Down
22 changes: 11 additions & 11 deletions include/beman/lazy/detail/any_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ namespace beman::lazy::detail {
*/
class any_scheduler {
struct state_base {
virtual ~state_base() = default;
virtual void complete_value() = 0;
virtual void complete_error(::std::error_code) = 0;
virtual void complete_error(::std::exception_ptr) = 0;
virtual void complete_stopped() = 0;
virtual ::beman::execution::inplace_stop_token get_stop_token() = 0;
virtual ~state_base() = default;
virtual void complete_value() = 0;
virtual void complete_error(::std::error_code) = 0;
virtual void complete_error(::std::exception_ptr) = 0;
virtual void complete_stopped() = 0;
virtual ::beman::execution::inplace_stop_token get_stop_token() = 0;
};

struct inner_state {
Expand Down Expand Up @@ -100,10 +100,10 @@ class any_scheduler {
decltype(::beman::execution::get_stop_token(::beman::execution::get_env(std::declval<Receiver>())));
using callback_t = ::beman::execution::stop_callback_for_t<token_t, stopper>;

std::remove_cvref_t<Receiver> receiver;
inner_state s;
::beman::execution::inplace_stop_source source;
::std::optional<callback_t> callback;
std::remove_cvref_t<Receiver> receiver;
inner_state s;
::beman::execution::inplace_stop_source source;
::std::optional<callback_t> callback;

template <::beman::execution::receiver R, typename PS>
state(R&& r, PS& ps) : receiver(std::forward<R>(r)), s(ps->connect(this)) {}
Expand All @@ -118,7 +118,7 @@ class any_scheduler {
if constexpr (::std::same_as<token_t, ::beman::execution::inplace_stop_token>) {
return ::beman::execution::get_stop_token(::beman::execution::get_env(this->receiver));
} else {
if constexpr (not::std::same_as<token_t, ::beman::execution::never_stop_token>) {
if constexpr (not ::std::same_as<token_t, ::beman::execution::never_stop_token>) {
if (not this->callback) {
this->callback.emplace(
::beman::execution::get_stop_token(::beman::execution::get_env(this->receiver)),
Expand Down

0 comments on commit 8d11524

Please sign in to comment.