Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ::experimental from coroutine namespace #198

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,15 +714,15 @@ namespace cppcoro
{
public:
bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept;
};

class async_mutex_scoped_lock_operation
{
public:
bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
[[nodiscard]] async_mutex_lock await_resume() const noexcept;
};

Expand Down Expand Up @@ -836,7 +836,7 @@ namespace cppcoro
async_manual_reset_event_operation(async_manual_reset_event& event) noexcept;

bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept;
};
}
Expand Down Expand Up @@ -904,7 +904,7 @@ namespace cppcoro
async_auto_reset_event_operation(const async_auto_reset_event_operation& other) noexcept;

bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept;

};
Expand Down Expand Up @@ -1389,7 +1389,7 @@ namespace cppcoro
schedule_operation(static_thread_pool* tp) noexcept;

bool await_ready() noexcept;
bool await_suspend(std::experimental::coroutine_handle<> h) noexcept;
bool await_suspend(std::coroutine_handle<> h) noexcept;
bool await_resume() noexcept;

private:
Expand Down Expand Up @@ -1546,7 +1546,7 @@ namespace cppcoro
schedule_operation& operator=(const schedule_operation&) noexcept;

bool await_ready() const noexcept;
void await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
void await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() noexcept;
};

Expand All @@ -1560,7 +1560,7 @@ namespace cppcoro
timed_schedule_operation& operator=(timed_schedule_operation&&) = delete;

bool await_ready() const noexcept;
void await_suspend(std::experimental::coroutine_handle<> awaiter);
void await_suspend(std::coroutine_handle<> awaiter);
void await_resume();
};

Expand Down Expand Up @@ -1596,7 +1596,7 @@ Example:
#include <algorithm>
#include <iostream>

namespace fs = std::experimental::filesystem;
namespace fs = std::filesystem;

cppcoro::task<std::uint64_t> count_lines(cppcoro::io_service& ioService, fs::path path)
{
Expand Down Expand Up @@ -1740,7 +1740,7 @@ namespace cppcoro
file_read_operation(file_read_operation&& other) noexcept;

bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter);
bool await_suspend(std::coroutine_handle<> awaiter);
std::size_t await_resume();

};
Expand All @@ -1752,7 +1752,7 @@ namespace cppcoro
file_write_operation(file_write_operation&& other) noexcept;

bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter);
bool await_suspend(std::coroutine_handle<> awaiter);
std::size_t await_resume();

};
Expand All @@ -1774,7 +1774,7 @@ namespace cppcoro
[[nodiscard]]
static read_only_file open(
io_service& ioService,
const std::experimental::filesystem::path& path,
const std::filesystem::path& path,
file_share_mode shareMode = file_share_mode::read,
file_buffering_mode bufferingMode = file_buffering_mode::default_);

Expand All @@ -1787,7 +1787,7 @@ namespace cppcoro
[[nodiscard]]
static write_only_file open(
io_service& ioService,
const std::experimental::filesystem::path& path,
const std::filesystem::path& path,
file_open_mode openMode = file_open_mode::create_or_open,
file_share_mode shareMode = file_share_mode::none,
file_buffering_mode bufferingMode = file_buffering_mode::default_);
Expand All @@ -1801,7 +1801,7 @@ namespace cppcoro
[[nodiscard]]
static read_write_file open(
io_service& ioService,
const std::experimental::filesystem::path& path,
const std::filesystem::path& path,
file_open_mode openMode = file_open_mode::create_or_open,
file_share_mode shareMode = file_share_mode::none,
file_buffering_mode bufferingMode = file_buffering_mode::default_);
Expand Down Expand Up @@ -2794,7 +2794,7 @@ coroutine.

A type that satisfies `Awaiter<T>` must have, for an instance of the type, `awaiter`:
- `awaiter.await_ready()` -> `bool`
- `awaiter.await_suspend(std::experimental::coroutine_handle<void>{})` -> `void` or `bool` or `std::experimental::coroutine_handle<P>` for some `P`.
- `awaiter.await_suspend(std::coroutine_handle<void>{})` -> `void` or `bool` or `std::coroutine_handle<P>` for some `P`.
- `awaiter.await_resume()` -> `T`

Any type that implements the `Awaiter<T>` concept also implements the `Awaitable<T>` concept.
Expand Down
4 changes: 2 additions & 2 deletions include/cppcoro/async_auto_reset_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ namespace cppcoro
async_auto_reset_event_operation(const async_auto_reset_event_operation& other) noexcept;

bool await_ready() const noexcept { return m_event == nullptr; }
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept {}

private:
Expand All @@ -89,7 +89,7 @@ namespace cppcoro

const async_auto_reset_event* m_event;
async_auto_reset_event_operation* m_next;
std::experimental::coroutine_handle<> m_awaiter;
std::coroutine_handle<> m_awaiter;
std::atomic<std::uint32_t> m_refCount;

};
Expand Down
50 changes: 25 additions & 25 deletions include/cppcoro/async_generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace cppcoro
async_generator_promise_base(const async_generator_promise_base& other) = delete;
async_generator_promise_base& operator=(const async_generator_promise_base& other) = delete;

std::experimental::suspend_always initial_suspend() const noexcept
std::suspend_always initial_suspend() const noexcept
{
return {};
}
Expand Down Expand Up @@ -89,7 +89,7 @@ namespace cppcoro

std::exception_ptr m_exception;

std::experimental::coroutine_handle<> m_consumerCoroutine;
std::coroutine_handle<> m_consumerCoroutine;

protected:

Expand All @@ -100,7 +100,7 @@ namespace cppcoro
{
public:

async_generator_yield_operation(std::experimental::coroutine_handle<> consumer) noexcept
async_generator_yield_operation(std::coroutine_handle<> consumer) noexcept
: m_consumer(consumer)
{}

Expand All @@ -109,8 +109,8 @@ namespace cppcoro
return false;
}

std::experimental::coroutine_handle<>
await_suspend([[maybe_unused]] std::experimental::coroutine_handle<> producer) noexcept
std::coroutine_handle<>
await_suspend([[maybe_unused]] std::coroutine_handle<> producer) noexcept
{
return m_consumer;
}
Expand All @@ -119,7 +119,7 @@ namespace cppcoro

private:

std::experimental::coroutine_handle<> m_consumer;
std::coroutine_handle<> m_consumer;

};

Expand All @@ -145,7 +145,7 @@ namespace cppcoro

async_generator_advance_operation(
async_generator_promise_base& promise,
std::experimental::coroutine_handle<> producerCoroutine) noexcept
std::coroutine_handle<> producerCoroutine) noexcept
: m_promise(std::addressof(promise))
, m_producerCoroutine(producerCoroutine)
{
Expand All @@ -155,8 +155,8 @@ namespace cppcoro

bool await_ready() const noexcept { return false; }

std::experimental::coroutine_handle<>
await_suspend(std::experimental::coroutine_handle<> consumerCoroutine) noexcept
std::coroutine_handle<>
await_suspend(std::coroutine_handle<> consumerCoroutine) noexcept
{
m_promise->m_consumerCoroutine = consumerCoroutine;
return m_producerCoroutine;
Expand All @@ -165,7 +165,7 @@ namespace cppcoro
protected:

async_generator_promise_base* m_promise;
std::experimental::coroutine_handle<> m_producerCoroutine;
std::coroutine_handle<> m_producerCoroutine;

};

Expand Down Expand Up @@ -242,7 +242,7 @@ namespace cppcoro
class async_generator_iterator final
{
using promise_type = async_generator_promise<T>;
using handle_type = std::experimental::coroutine_handle<promise_type>;
using handle_type = std::coroutine_handle<promise_type>;

public:

Expand Down Expand Up @@ -307,7 +307,7 @@ namespace cppcoro
class async_generator_begin_operation final : public async_generator_advance_operation
{
using promise_type = async_generator_promise<T>;
using handle_type = std::experimental::coroutine_handle<promise_type>;
using handle_type = std::coroutine_handle<promise_type>;

public:

Expand Down Expand Up @@ -358,7 +358,7 @@ namespace cppcoro
{}

explicit async_generator(promise_type& promise) noexcept
: m_coroutine(std::experimental::coroutine_handle<promise_type>::from_promise(promise))
: m_coroutine(std::coroutine_handle<promise_type>::from_promise(promise))
{}

async_generator(async_generator&& other) noexcept
Expand Down Expand Up @@ -408,7 +408,7 @@ namespace cppcoro

private:

std::experimental::coroutine_handle<promise_type> m_coroutine;
std::coroutine_handle<promise_type> m_coroutine;

};

Expand Down Expand Up @@ -451,7 +451,7 @@ namespace cppcoro
async_generator_promise_base(const async_generator_promise_base& other) = delete;
async_generator_promise_base& operator=(const async_generator_promise_base& other) = delete;

std::experimental::suspend_always initial_suspend() const noexcept
std::suspend_always initial_suspend() const noexcept
{
return {};
}
Expand Down Expand Up @@ -556,7 +556,7 @@ namespace cppcoro

std::exception_ptr m_exception;

std::experimental::coroutine_handle<> m_consumerCoroutine;
std::coroutine_handle<> m_consumerCoroutine;

protected:

Expand All @@ -579,7 +579,7 @@ namespace cppcoro
return m_initialState == state::value_not_ready_consumer_suspended;
}

bool await_suspend(std::experimental::coroutine_handle<> producer) noexcept;
bool await_suspend(std::coroutine_handle<> producer) noexcept;

void await_resume() noexcept {}

Expand Down Expand Up @@ -625,7 +625,7 @@ namespace cppcoro
}

inline bool async_generator_yield_operation::await_suspend(
std::experimental::coroutine_handle<> producer) noexcept
std::coroutine_handle<> producer) noexcept
{
state currentState = m_initialState;
if (currentState == state::value_not_ready_consumer_active)
Expand Down Expand Up @@ -711,7 +711,7 @@ namespace cppcoro

async_generator_advance_operation(
async_generator_promise_base& promise,
std::experimental::coroutine_handle<> producerCoroutine) noexcept
std::coroutine_handle<> producerCoroutine) noexcept
: m_promise(std::addressof(promise))
, m_producerCoroutine(producerCoroutine)
{
Expand Down Expand Up @@ -740,7 +740,7 @@ namespace cppcoro
return m_initialState == state::value_ready_producer_suspended;
}

bool await_suspend(std::experimental::coroutine_handle<> consumerCoroutine) noexcept
bool await_suspend(std::coroutine_handle<> consumerCoroutine) noexcept
{
m_promise->m_consumerCoroutine = consumerCoroutine;

Expand Down Expand Up @@ -791,7 +791,7 @@ namespace cppcoro
protected:

async_generator_promise_base* m_promise;
std::experimental::coroutine_handle<> m_producerCoroutine;
std::coroutine_handle<> m_producerCoroutine;

private:

Expand Down Expand Up @@ -872,7 +872,7 @@ namespace cppcoro
class async_generator_iterator final
{
using promise_type = async_generator_promise<T>;
using handle_type = std::experimental::coroutine_handle<promise_type>;
using handle_type = std::coroutine_handle<promise_type>;

public:

Expand Down Expand Up @@ -937,7 +937,7 @@ namespace cppcoro
class async_generator_begin_operation final : public async_generator_advance_operation
{
using promise_type = async_generator_promise<T>;
using handle_type = std::experimental::coroutine_handle<promise_type>;
using handle_type = std::coroutine_handle<promise_type>;

public:

Expand Down Expand Up @@ -988,7 +988,7 @@ namespace cppcoro
{}

explicit async_generator(promise_type& promise) noexcept
: m_coroutine(std::experimental::coroutine_handle<promise_type>::from_promise(promise))
: m_coroutine(std::coroutine_handle<promise_type>::from_promise(promise))
{}

async_generator(async_generator&& other) noexcept
Expand Down Expand Up @@ -1041,7 +1041,7 @@ namespace cppcoro

private:

std::experimental::coroutine_handle<promise_type> m_coroutine;
std::coroutine_handle<promise_type> m_coroutine;

};

Expand Down
4 changes: 2 additions & 2 deletions include/cppcoro/async_manual_reset_event.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace cppcoro
explicit async_manual_reset_event_operation(const async_manual_reset_event& event) noexcept;

bool await_ready() const noexcept;
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept {}

private:
Expand All @@ -96,7 +96,7 @@ namespace cppcoro

const async_manual_reset_event& m_event;
async_manual_reset_event_operation* m_next;
std::experimental::coroutine_handle<> m_awaiter;
std::coroutine_handle<> m_awaiter;

};
}
Expand Down
4 changes: 2 additions & 2 deletions include/cppcoro/async_mutex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ namespace cppcoro
{}

bool await_ready() const noexcept { return false; }
bool await_suspend(std::experimental::coroutine_handle<> awaiter) noexcept;
bool await_suspend(std::coroutine_handle<> awaiter) noexcept;
void await_resume() const noexcept {}

protected:
Expand All @@ -178,7 +178,7 @@ namespace cppcoro
private:

async_mutex_lock_operation* m_next;
std::experimental::coroutine_handle<> m_awaiter;
std::coroutine_handle<> m_awaiter;

};

Expand Down
Loading