1
0
mirror of https://github.com/tearshark/librf.git synced 2024-10-01 15:57:07 +08:00

整理代码

This commit is contained in:
tearshark 2020-06-19 23:13:41 +08:00
parent cbeefbba2e
commit e43182d58b
9 changed files with 21 additions and 21 deletions

View File

@ -17,11 +17,11 @@ namespace resumef
using lock_type = typename state_type::lock_type; using lock_type = typename state_type::lock_type;
using _Alloc_char = typename state_type::_Alloc_char; using _Alloc_char = typename state_type::_Alloc_char;
awaitable_impl_t() {} awaitable_impl_t() noexcept = default;
awaitable_impl_t(const awaitable_impl_t&) = default; awaitable_impl_t(const awaitable_impl_t&) noexcept = default;
awaitable_impl_t(awaitable_impl_t&&) = default; awaitable_impl_t(awaitable_impl_t&&) noexcept = default;
awaitable_impl_t& operator = (const awaitable_impl_t&) = default; awaitable_impl_t& operator = (const awaitable_impl_t&) noexcept = default;
awaitable_impl_t& operator = (awaitable_impl_t&&) = default; awaitable_impl_t& operator = (awaitable_impl_t&&) = default;
/** /**
@ -46,7 +46,7 @@ namespace resumef
/** /**
* @brief future_t<>(awaitable function) * @brief future_t<>(awaitable function)
*/ */
future_type get_future() noexcept future_type get_future() const noexcept
{ {
return future_type{ this->_state }; return future_type{ this->_state };
} }

View File

@ -23,13 +23,13 @@ namespace resumef
future_t(counted_ptr<state_type> _st) noexcept future_t(counted_ptr<state_type> _st) noexcept
:_state(std::move(_st)) {} :_state(std::move(_st)) {}
future_t(const future_t&) = default; future_t(const future_t&) noexcept = default;
future_t(future_t&&) = default; future_t(future_t&&) noexcept = default;
future_t& operator = (const future_t&) = default; future_t& operator = (const future_t&) noexcept = default;
future_t& operator = (future_t&&) = default; future_t& operator = (future_t&&) = default;
bool await_ready() noexcept bool await_ready() const noexcept
{ {
return _state->future_await_ready(); return _state->future_await_ready();
} }
@ -40,7 +40,7 @@ namespace resumef
_state->future_await_suspend(handler); _state->future_await_suspend(handler);
} }
value_type await_resume() value_type await_resume() const
{ {
return _state->future_await_resume(); return _state->future_await_resume();
} }

View File

@ -17,7 +17,7 @@ namespace resumef
using promise_type = promise_t<value_type>; using promise_type = promise_t<value_type>;
using future_type = future_t<value_type>; using future_type = future_t<value_type>;
promise_impl_t() noexcept {} promise_impl_t() noexcept = default;
promise_impl_t(promise_impl_t&& _Right) noexcept = default; promise_impl_t(promise_impl_t&& _Right) noexcept = default;
promise_impl_t& operator = (promise_impl_t&& _Right) noexcept = default; promise_impl_t& operator = (promise_impl_t&& _Right) noexcept = default;
promise_impl_t(const promise_impl_t&) = delete; promise_impl_t(const promise_impl_t&) = delete;

View File

@ -2,7 +2,7 @@
namespace resumef namespace resumef
{ {
task_t::task_t() task_t::task_t() noexcept
: _stop(nostopstate) : _stop(nostopstate)
{ {
} }

View File

@ -16,7 +16,7 @@ namespace resumef
*/ */
struct task_t struct task_t
{ {
task_t(); task_t() noexcept;
virtual ~task_t(); virtual ~task_t();
/** /**
@ -47,7 +47,7 @@ namespace resumef
* @brief * @brief
* @return bool * @return bool
*/ */
bool request_stop_if_possible() bool request_stop_if_possible() const
{ {
if (_stop.stop_possible()) if (_stop.stop_possible())
return _stop.request_stop(); return _stop.request_stop();
@ -73,7 +73,7 @@ namespace resumef
using value_type = typename future_type::value_type; using value_type = typename future_type::value_type;
using state_type = state_t<value_type>; using state_type = state_t<value_type>;
task_impl_t() = default; task_impl_t() noexcept = default;
task_impl_t(future_type& f) task_impl_t(future_type& f)
{ {
initialize(f); initialize(f);
@ -92,7 +92,7 @@ namespace resumef
using future_type = generator_t<value_type>; using future_type = generator_t<value_type>;
using state_type = state_generator_t; using state_type = state_generator_t;
task_impl_t() = default; task_impl_t() noexcept = default;
task_impl_t(future_type& f) task_impl_t(future_type& f)
{ {
initialize(f); initialize(f);

View File

@ -58,7 +58,7 @@ namespace resumef
} }
} }
local_scheduler_t::local_scheduler_t(scheduler_t& sch) local_scheduler_t::local_scheduler_t(scheduler_t& sch) noexcept
{ {
if (th_scheduler_ptr == nullptr) if (th_scheduler_ptr == nullptr)
{ {

View File

@ -132,7 +132,7 @@ namespace resumef
/** /**
* @brief 线 * @brief 线
*/ */
local_scheduler_t(scheduler_t & sch); local_scheduler_t(scheduler_t & sch) noexcept;
/** /**
* @brief 线local_scheduler_t所创建线 * @brief 线local_scheduler_t所创建线

View File

@ -20,7 +20,7 @@ namespace resumef
switch_scheduler_awaitor& operator = (const switch_scheduler_awaitor&) = default; switch_scheduler_awaitor& operator = (const switch_scheduler_awaitor&) = default;
switch_scheduler_awaitor& operator = (switch_scheduler_awaitor&&) = default; switch_scheduler_awaitor& operator = (switch_scheduler_awaitor&&) = default;
bool await_ready() noexcept bool await_ready() const noexcept
{ {
return false; return false;
} }
@ -41,7 +41,7 @@ namespace resumef
return false; return false;
} }
void await_resume() noexcept void await_resume() const noexcept
{ {
} }

View File

@ -46,7 +46,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset> <PlatformToolset>ClangCL</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
</PropertyGroup> </PropertyGroup>