Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ ifeq (${hostSystemName},Darwin)
ifeq ($(origin CXX),default)
$(info CXX is using the built-in default: $(CXX))
export CXX=g++-15
export CXXFLAGS=-stdlib=libstdc++
CXXLIB=libstdc++
export CXXFLAGS=-stdlib=$(CXXLIB)
endif
export GCOV="gcov"
else ifeq (${hostSystemName},Linux)
Expand Down
1 change: 1 addition & 0 deletions bin/mk-module.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def get_dependencies(component):

def write_header(to, header):
filename = f"include/{header}.hpp"
print(f"writing {filename}...")
with open(filename) as file:
number = 0
for line in file.readlines():
Expand Down
1 change: 1 addition & 0 deletions bin/run-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docker run -it --rm -v $PWD:$PWD -u $(id -u):$(id -g) ghcr.io/bemanproject/infra-containers-gcc:15 bash
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,16 @@ set(EXAMPLES
)

if(BEMAN_USE_MODULES)
list(APPEND EXAMPLES modules modules-and-header)
#-dk:TODO gcc doesn't like the modules: list(APPEND EXAMPLES modules modules-and-header)
list(APPEND EXAMPLES modules-and-header)
endif()

foreach(EXAMPLE ${EXAMPLES})
set(EXAMPLE_TARGET ${PROJECT_NAME}.${EXAMPLE})
add_executable(${EXAMPLE_TARGET})
target_sources(${EXAMPLE_TARGET} PRIVATE ${EXAMPLE}.cpp)
if(BEMAN_USE_MODULES)
target_compile_definitions(${EXAMPLE_TARGET} PUBLIC BEMAN_HAS_MODULES)
target_link_libraries(${EXAMPLE_TARGET} PRIVATE beman::execution)
else()
target_link_libraries(
Expand Down
1 change: 1 addition & 0 deletions examples/intro-5-consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cinttypes>
#ifdef BEMAN_HAS_MODULES
import beman.execution;
import beman.execution.detail;
#else
#include <beman/execution/execution.hpp>
#endif
Expand Down
4 changes: 4 additions & 0 deletions examples/just_stopped.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// examples/just_stopped.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#ifdef BEMAN_HAS_MODULES
import beman.execution;
#else
#include <beman/execution/execution.hpp>
#endif
namespace ex = beman::execution;

struct receiver {
Expand Down
4 changes: 0 additions & 4 deletions examples/modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ import std;

#endif

#ifdef BEMAN_HAS_MODULES
import beman.execution;
#else
#include <beman/execution/execution.hpp>
#endif

namespace ex = beman::execution;

Expand Down
1 change: 1 addition & 0 deletions examples/sender-demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <variant>
#ifdef BEMAN_HAS_MODULES
import beman.execution;
import beman.execution.detail;
#else
#include <beman/execution/execution.hpp>
#endif
Expand Down
46 changes: 39 additions & 7 deletions include/beman/execution/detail/affine_on.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,41 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_AFFINE_ON

#include <beman/execution/detail/common.hpp>
#include <beman/execution/detail/suppress_push.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <concepts>
#include <type_traits>
#include <utility>
#endif
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.completion_signatures;
import beman.execution.detail.env;
import beman.execution.detail.forward_like;
import beman.execution.detail.fwd_env;
import beman.execution.detail.get_completion_signatures;
import beman.execution.detail.get_domain_early;
import beman.execution.detail.get_scheduler;
import beman.execution.detail.get_stop_token;
import beman.execution.detail.join_env;
import beman.execution.detail.make_sender;
import beman.execution.detail.never_stop_token;
import beman.execution.detail.nested_sender_has_affine_on;
import beman.execution.detail.prop;
import beman.execution.detail.schedule;
import beman.execution.detail.schedule_from;
import beman.execution.detail.scheduler;
import beman.execution.detail.sender;
import beman.execution.detail.sender_adaptor;
import beman.execution.detail.sender_adaptor_closure;
import beman.execution.detail.sender_for;
import beman.execution.detail.sender_has_affine_on;
import beman.execution.detail.set_value;
import beman.execution.detail.tag_of_t;
import beman.execution.detail.transform_sender;
import beman.execution.detail.write_env;
#else
#include <beman/execution/detail/env.hpp>
#include <beman/execution/detail/forward_like.hpp>
#include <beman/execution/detail/fwd_env.hpp>
Expand All @@ -25,11 +60,7 @@
#include <beman/execution/detail/tag_of_t.hpp>
#include <beman/execution/detail/transform_sender.hpp>
#include <beman/execution/detail/write_env.hpp>

#include <concepts>
#include <type_traits>

#include <beman/execution/detail/suppress_push.hpp>
#endif

// ----------------------------------------------------------------------------

Expand Down Expand Up @@ -66,7 +97,7 @@ struct affine_on_t : ::beman::execution::sender_adaptor_closure<affine_on_t> {
*/
template <::beman::execution::sender Sender>
auto operator()(Sender&& sender) const {
return ::beman::execution::detail::transform_sender(
return ::beman::execution::transform_sender(
::beman::execution::detail::get_domain_early(sender),
::beman::execution::detail::make_sender(
*this, ::beman::execution::env<>{}, ::std::forward<Sender>(sender)));
Expand Down Expand Up @@ -111,7 +142,8 @@ struct affine_on_t : ::beman::execution::sender_adaptor_closure<affine_on_t> {
} -> ::std::same_as<::beman::execution::completion_signatures<::beman::execution::set_value_t()>>;
}
static auto transform_sender(Sender&& sender, const Env& ev) {
[[maybe_unused]] auto& [tag, data, child] = sender;
//[[maybe_unused]] auto& [tag, data, child] = sender;
auto& child = sender.template get<2>();
using child_tag_t = ::beman::execution::tag_of_t<::std::remove_cvref_t<decltype(child)>>;

if constexpr (::beman::execution::detail::nested_sender_has_affine_on<Sender, Env>) {
Expand Down
16 changes: 13 additions & 3 deletions include/beman/execution/detail/allocator_aware_move.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_ALLOCATOR_AWARE_MOVE

#include <beman/execution/detail/common.hpp>
#include <beman/execution/detail/product_type.hpp>
#include <beman/execution/detail/get_allocator.hpp>
#include <beman/execution/detail/get_env.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <exception>
#include <memory>
#include <utility>
#endif
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.get_allocator;
import beman.execution.detail.get_env;
import beman.execution.detail.product_type;
#else
#include <beman/execution/detail/get_allocator.hpp>
#include <beman/execution/detail/get_env.hpp>
#include <beman/execution/detail/product_type.hpp>
#endif

// ----------------------------------------------------------------------------

Expand Down
15 changes: 13 additions & 2 deletions include/beman/execution/detail/almost_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,23 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_ALMOST_SCHEDULER

#include <beman/execution/detail/common.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <concepts>
#include <utility>
#endif
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.queryable;
import beman.execution.detail.schedule;
import beman.execution.detail.scheduler_t;
import beman.execution.detail.sender;
#else
#include <beman/execution/detail/queryable.hpp>
#include <beman/execution/detail/schedule.hpp>
#include <beman/execution/detail/scheduler_t.hpp>
#include <beman/execution/detail/sender.hpp>
#include <concepts>
#include <utility>
#endif

// ----------------------------------------------------------------------------

Expand Down
11 changes: 10 additions & 1 deletion include/beman/execution/detail/apply_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,18 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_APPLY_SENDER

#include <beman/execution/detail/common.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <utility>
#endif
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.default_domain;
import beman.execution.detail.sender;
#else
#include <beman/execution/detail/default_domain.hpp>
#include <beman/execution/detail/sender.hpp>
#include <utility>
#endif

// ----------------------------------------------------------------------------

Expand Down
18 changes: 14 additions & 4 deletions include/beman/execution/detail/as_awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,24 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_AWAITABLE

#include <beman/execution/detail/common.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <coroutine>
#include <type_traits>
#include <utility>
#endif
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.awaitable_sender;
import beman.execution.detail.is_awaitable;
import beman.execution.detail.sender_awaitable;
import beman.execution.detail.unspecified_promise;
#else
#include <beman/execution/detail/awaitable_sender.hpp>
#include <beman/execution/detail/is_awaitable.hpp>
#include <beman/execution/detail/sender_awaitable.hpp>
#include <beman/execution/detail/unspecified_promise.hpp>

#include <coroutine>
#include <type_traits>
#include <utility>
#endif

// ----------------------------------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions include/beman/execution/detail/as_except_ptr.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_EXCEPT_PTR

#include <beman/execution/detail/common.hpp>
#ifdef BEMAN_HAS_IMPORT_STD
import std;
#else
#include <cassert>
#include <concepts>
#include <exception>
#include <system_error>
#include <type_traits>
#include <utility>
#endif

// ----------------------------------------------------------------------------

Expand Down
4 changes: 4 additions & 0 deletions include/beman/execution/detail/as_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
#define INCLUDED_BEMAN_EXECUTION_DETAIL_AS_TUPLE

#include <beman/execution/detail/common.hpp>
#ifdef BEMAN_HAS_MODULES
import beman.execution.detail.decayed_tuple;
#else
#include <beman/execution/detail/decayed_tuple.hpp>
#endif

// ----------------------------------------------------------------------------

Expand Down
Loading