Skip to content

Commit 41ce46a

Browse files
committed
fixup names for old gcc
1 parent f02eacc commit 41ce46a

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

bench/source/calibrate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace {
99

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

1212
void calibrate(benchmark::State &state) {
1313

include/libfork/core/first_arg.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ concept async_function_object = std::is_object_v<F> && std::copy_constructible<F
6969
* @brief This describes the public-API of the first argument passed to an async function.
7070
*
7171
* An async functions' invocability and return type must be independent of their first argument except for its
72-
* tag value. A user may query the first argument's static member `tag` to obtain this value. Additionally, a
73-
* user may query the first argument's static member function `context()` to obtain a pointer to the current
72+
* tag value. A user may query the first argument's static member `tagged` to obtain this value. Additionally,
73+
* a user may query the first argument's static member function `context()` to obtain a pointer to the current
7474
* workers `lf::context`. Finally a user may cache an exception in-flight by calling `.stash_exception()`.
7575
*/
7676
template <typename T>
7777
concept first_arg = async_function_object<T> && requires (T arg) {
78-
{ T::tag } -> std::convertible_to<tag>;
78+
{ T::tagged } -> std::convertible_to<tag>;
7979
{ T::context() } -> std::same_as<context *>;
8080
{ arg.stash_exception() } noexcept;
8181
};
@@ -98,7 +98,7 @@ namespace impl {
9898
template <quasi_pointer I, tag Tag, async_function_object F, typename... Cargs>
9999
class first_arg_t {
100100
public:
101-
static constexpr tag tag = Tag; ///< The way this async function was called.
101+
static constexpr tag tagged = Tag; ///< The way this async function was called.
102102

103103
first_arg_t() = default;
104104

include/libfork/core/impl/combinate.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct promise;
3939
*/
4040
template <returnable R, return_address_for<R> I, tag Tag>
4141
struct [[nodiscard("A quasi_awaitable MUST be immediately co_awaited!")]] quasi_awaitable {
42-
promise<R, I, Tag> *promise; ///< The parent/semaphore needs to be set!
42+
promise<R, I, Tag> *prom; ///< The parent/semaphore needs to be set!
4343
};
4444

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

73-
auto *prom = static_cast<P *>(task.promise);
73+
auto *prom = static_cast<P *>(task.prom);
7474

7575
if constexpr (!std::is_void_v<R>) {
7676
prom->set_return(std::move(ret));

include/libfork/core/impl/promise.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,14 @@ struct promise_base : frame {
215215
requires (Tg == tag::call || Tg == tag::fork)
216216
auto await_transform(quasi_awaitable<R2, I2, Tg> awaitable) noexcept {
217217

218-
awaitable.promise->set_parent(this);
218+
awaitable.prom->set_parent(this);
219219

220220
if constexpr (Tg == tag::call) {
221-
return call_awaitable{{}, awaitable.promise};
221+
return call_awaitable{{}, awaitable.prom};
222222
}
223223

224224
if constexpr (Tg == tag::fork) {
225-
return fork_awaitable{{}, awaitable.promise, this};
225+
return fork_awaitable{{}, awaitable.prom, this};
226226
}
227227
}
228228
};

include/libfork/core/sync_wait.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ auto sync_wait(Sch &&sch, F fun, Args &&...args) -> async_result_t<F, Args...> {
9898

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

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

include/libfork/core/task.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ concept returnable = std::is_void_v<T> || std::is_reference_v<T> || std::movable
5757
*/
5858
template <returnable T = void>
5959
struct LF_CORO_ATTRIBUTES task : std::type_identity<T> {
60-
void *promise; ///< An opaque handle to the coroutine promise.
60+
void *prom; ///< An opaque handle to the coroutine promise.
6161
};
6262

6363
} // namespace core

single_header/libfork.hpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2739,7 +2739,7 @@ concept returnable = std::is_void_v<T> || std::is_reference_v<T> || std::movable
27392739
*/
27402740
template <returnable T = void>
27412741
struct LF_CORO_ATTRIBUTES task : std::type_identity<T> {
2742-
void *promise; ///< An opaque handle to the coroutine promise.
2742+
void *prom; ///< An opaque handle to the coroutine promise.
27432743
};
27442744

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

29952995
first_arg_t() = default;
29962996

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

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

3586-
auto *prom = static_cast<P *>(task.promise);
3586+
auto *prom = static_cast<P *>(task.prom);
35873587

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

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

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

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

4245-
awaitable.promise->set_parent(this);
4245+
awaitable.prom->set_parent(this);
42464246

42474247
if constexpr (Tg == tag::call) {
4248-
return call_awaitable{{}, awaitable.promise};
4248+
return call_awaitable{{}, awaitable.prom};
42494249
}
42504250

42514251
if constexpr (Tg == tag::fork) {
4252-
return fork_awaitable{{}, awaitable.promise, this};
4252+
return fork_awaitable{{}, awaitable.prom, this};
42534253
}
42544254
}
42554255
};

0 commit comments

Comments
 (0)