Skip to content

Commit

Permalink
fixup names for old gcc
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorWilliams committed Jan 7, 2024
1 parent f02eacc commit 41ce46a
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bench/source/calibrate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace {

LF_NOINLINE constexpr auto sleep() -> void { std::this_thread::sleep_for(std::chrono::milliseconds(500)); };
LF_NOINLINE auto sleep() -> void { std::this_thread::sleep_for(std::chrono::milliseconds(500)); };

void calibrate(benchmark::State &state) {

Expand Down
8 changes: 4 additions & 4 deletions include/libfork/core/first_arg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ concept async_function_object = std::is_object_v<F> && std::copy_constructible<F
* @brief This describes the public-API of the first argument passed to an async function.
*
* An async functions' invocability and return type must be independent of their first argument except for its
* tag value. A user may query the first argument's static member `tag` to obtain this value. Additionally, a
* user may query the first argument's static member function `context()` to obtain a pointer to the current
* tag value. A user may query the first argument's static member `tagged` to obtain this value. Additionally,
* a user may query the first argument's static member function `context()` to obtain a pointer to the current
* workers `lf::context`. Finally a user may cache an exception in-flight by calling `.stash_exception()`.
*/
template <typename T>
concept first_arg = async_function_object<T> && requires (T arg) {
{ T::tag } -> std::convertible_to<tag>;
{ T::tagged } -> std::convertible_to<tag>;
{ T::context() } -> std::same_as<context *>;
{ arg.stash_exception() } noexcept;
};
Expand All @@ -98,7 +98,7 @@ namespace impl {
template <quasi_pointer I, tag Tag, async_function_object F, typename... Cargs>
class first_arg_t {
public:
static constexpr tag tag = Tag; ///< The way this async function was called.
static constexpr tag tagged = Tag; ///< The way this async function was called.

first_arg_t() = default;

Expand Down
4 changes: 2 additions & 2 deletions include/libfork/core/impl/combinate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct promise;
*/
template <returnable R, return_address_for<R> I, tag Tag>
struct [[nodiscard("A quasi_awaitable MUST be immediately co_awaited!")]] quasi_awaitable {
promise<R, I, Tag> *promise; ///< The parent/semaphore needs to be set!
promise<R, I, Tag> *prom; ///< The parent/semaphore needs to be set!
};

// ---------------------------- //
Expand Down Expand Up @@ -70,7 +70,7 @@ struct [[nodiscard("A bound function SHOULD be immediately invoked!")]] y_combin
using R = async_result_t<F, Args...>;
using P = promise<R, I, Tag>;

auto *prom = static_cast<P *>(task.promise);
auto *prom = static_cast<P *>(task.prom);

if constexpr (!std::is_void_v<R>) {
prom->set_return(std::move(ret));
Expand Down
6 changes: 3 additions & 3 deletions include/libfork/core/impl/promise.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@ struct promise_base : frame {
requires (Tg == tag::call || Tg == tag::fork)
auto await_transform(quasi_awaitable<R2, I2, Tg> awaitable) noexcept {

awaitable.promise->set_parent(this);
awaitable.prom->set_parent(this);

if constexpr (Tg == tag::call) {
return call_awaitable{{}, awaitable.promise};
return call_awaitable{{}, awaitable.prom};
}

if constexpr (Tg == tag::fork) {
return fork_awaitable{{}, awaitable.promise, this};
return fork_awaitable{{}, awaitable.prom, this};
}
}
};
Expand Down
4 changes: 2 additions & 2 deletions include/libfork/core/sync_wait.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ auto sync_wait(Sch &&sch, F fun, Args &&...args) -> async_result_t<F, Args...> {

[&]() noexcept {
//
await.promise->set_root_notify(&notifier);
auto *handle = std::bit_cast<submit_handle>(static_cast<impl::frame *>(await.promise));
await.prom->set_root_notify(&notifier);
auto *handle = std::bit_cast<submit_handle>(static_cast<impl::frame *>(await.prom));

impl::ignore_t{} = impl::tls::thread_stack->release();

Expand Down
2 changes: 1 addition & 1 deletion include/libfork/core/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ concept returnable = std::is_void_v<T> || std::is_reference_v<T> || std::movable
*/
template <returnable T = void>
struct LF_CORO_ATTRIBUTES task : std::type_identity<T> {
void *promise; ///< An opaque handle to the coroutine promise.
void *prom; ///< An opaque handle to the coroutine promise.
};

} // namespace core
Expand Down
24 changes: 12 additions & 12 deletions single_header/libfork.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2739,7 +2739,7 @@ concept returnable = std::is_void_v<T> || std::is_reference_v<T> || std::movable
*/
template <returnable T = void>
struct LF_CORO_ATTRIBUTES task : std::type_identity<T> {
void *promise; ///< An opaque handle to the coroutine promise.
void *prom; ///< An opaque handle to the coroutine promise.
};

} // namespace core
Expand Down Expand Up @@ -2961,13 +2961,13 @@ concept async_function_object = std::is_object_v<F> && std::copy_constructible<F
* @brief This describes the public-API of the first argument passed to an async function.
*
* An async functions' invocability and return type must be independent of their first argument except for its
* tag value. A user may query the first argument's static member `tag` to obtain this value. Additionally, a
* user may query the first argument's static member function `context()` to obtain a pointer to the current
* tag value. A user may query the first argument's static member `tagged` to obtain this value. Additionally,
* a user may query the first argument's static member function `context()` to obtain a pointer to the current
* workers `lf::context`. Finally a user may cache an exception in-flight by calling `.stash_exception()`.
*/
template <typename T>
concept first_arg = async_function_object<T> && requires (T arg) {
{ T::tag } -> std::convertible_to<tag>;
{ T::tagged } -> std::convertible_to<tag>;
{ T::context() } -> std::same_as<context *>;
{ arg.stash_exception() } noexcept;
};
Expand All @@ -2990,7 +2990,7 @@ namespace impl {
template <quasi_pointer I, tag Tag, async_function_object F, typename... Cargs>
class first_arg_t {
public:
static constexpr tag tag = Tag; ///< The way this async function was called.
static constexpr tag tagged = Tag; ///< The way this async function was called.

first_arg_t() = default;

Expand Down Expand Up @@ -3552,7 +3552,7 @@ struct promise;
*/
template <returnable R, return_address_for<R> I, tag Tag>
struct [[nodiscard("A quasi_awaitable MUST be immediately co_awaited!")]] quasi_awaitable {
promise<R, I, Tag> *promise; ///< The parent/semaphore needs to be set!
promise<R, I, Tag> *prom; ///< The parent/semaphore needs to be set!
};

// ---------------------------- //
Expand Down Expand Up @@ -3583,7 +3583,7 @@ struct [[nodiscard("A bound function SHOULD be immediately invoked!")]] y_combin
using R = async_result_t<F, Args...>;
using P = promise<R, I, Tag>;

auto *prom = static_cast<P *>(task.promise);
auto *prom = static_cast<P *>(task.prom);

if constexpr (!std::is_void_v<R>) {
prom->set_return(std::move(ret));
Expand Down Expand Up @@ -3857,8 +3857,8 @@ auto sync_wait(Sch &&sch, F fun, Args &&...args) -> async_result_t<F, Args...> {

[&]() noexcept {
//
await.promise->set_root_notify(&notifier);
auto *handle = std::bit_cast<submit_handle>(static_cast<impl::frame *>(await.promise));
await.prom->set_root_notify(&notifier);
auto *handle = std::bit_cast<submit_handle>(static_cast<impl::frame *>(await.prom));

impl::ignore_t{} = impl::tls::thread_stack->release();

Expand Down Expand Up @@ -4242,14 +4242,14 @@ struct promise_base : frame {
requires (Tg == tag::call || Tg == tag::fork)
auto await_transform(quasi_awaitable<R2, I2, Tg> awaitable) noexcept {

awaitable.promise->set_parent(this);
awaitable.prom->set_parent(this);

if constexpr (Tg == tag::call) {
return call_awaitable{{}, awaitable.promise};
return call_awaitable{{}, awaitable.prom};
}

if constexpr (Tg == tag::fork) {
return fork_awaitable{{}, awaitable.promise, this};
return fork_awaitable{{}, awaitable.prom, this};
}
}
};
Expand Down

0 comments on commit 41ce46a

Please sign in to comment.