1#ifndef NEFORCE_CORE_ASYNC_LAZY_THREAD_HPP__
2#define NEFORCE_CORE_ASYNC_LAZY_THREAD_HPP__
13NEFORCE_BEGIN_NAMESPACE__
66 template <typename F, typename... Args>
113 bool joinable() const noexcept {
return thread_.joinable(); }
121 void join() { thread_.join(); }
142 _NEFORCE
swap(func_, other.func_);
143 _NEFORCE
swap(thread_, other.thread_);
151NEFORCE_END_NAMESPACE__
bool joinable() const noexcept
检查线程是否可被等待
thread::id get_id() const noexcept
获取线程标识符
lazy_thread & operator=(lazy_thread &&other) noexcept
移动赋值运算符
void swap(lazy_thread &other) noexcept
交换两个延迟线程对象
thread::native_handle_type native_handle_type
原生句柄类型
lazy_thread() noexcept=default
默认构造函数
lazy_thread(lazy_thread &&other) noexcept
移动构造函数
::pthread_t native_handle_type
系统线程句柄类型
NEFORCE_NODISCARD constexpr T && forward(remove_reference_t< T > &x) noexcept
完美转发左值
constexpr Iterator2 move(Iterator1 first, Iterator1 last, Iterator2 result) noexcept(noexcept(inner::__move_aux(first, last, result)))
移动范围元素
void swap()=delete
删除无参数的swap重载
NEFORCE_NODISCARD constexpr tuple< unwrap_ref_decay_t< Types >... > make_tuple(Types &&... args)
从参数创建元组
constexpr decltype(auto) apply(Func &&f, Tuple &&t) noexcept(inner::__apply_unpack_tuple< _NEFORCE is_nothrow_invocable, Func, Tuple >::value)
将元组元素解包作为参数调用函数