add consts
This commit is contained in:
parent
cd9c722aa0
commit
1061f2144b
|
@ -84,10 +84,10 @@ struct oper_table_t {
|
||||||
oper_table_t& operator=(oper_table_t&&) = delete;
|
oper_table_t& operator=(oper_table_t&&) = delete;
|
||||||
~oper_table_t() = default;
|
~oper_table_t() = default;
|
||||||
|
|
||||||
bool is_in_buffer;
|
const bool is_in_buffer;
|
||||||
call_oper_t call;
|
const call_oper_t call;
|
||||||
move_oper_t move;
|
const move_oper_t move;
|
||||||
dtor_oper_t dtor;
|
const dtor_oper_t dtor;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
oper_table_t(bool is_in_buffer_, call_oper_t call_, move_oper_t move_, dtor_oper_t dtor_) :
|
oper_table_t(bool is_in_buffer_, call_oper_t call_, move_oper_t move_, dtor_oper_t dtor_) :
|
||||||
|
@ -122,7 +122,7 @@ public:
|
||||||
inplace_task() noexcept { oper_ptr = oper_table_t::get_empty(); }
|
inplace_task() noexcept { oper_ptr = oper_table_t::get_empty(); }
|
||||||
|
|
||||||
template <typename T, task_details::enable_small_capture<T, capacity> = true>
|
template <typename T, task_details::enable_small_capture<T, capacity> = true>
|
||||||
inplace_task(T&& function)
|
inplace_task(T&& function) noexcept
|
||||||
{
|
{
|
||||||
using FunT = typename std::decay<T>::type;
|
using FunT = typename std::decay<T>::type;
|
||||||
oper_ptr = oper_table_t::template get_small<FunT>();
|
oper_ptr = oper_table_t::template get_small<FunT>();
|
||||||
|
@ -177,7 +177,7 @@ public:
|
||||||
} else if (not oper_ptr->is_in_buffer and other.oper_ptr->is_in_buffer) {
|
} else if (not oper_ptr->is_in_buffer and other.oper_ptr->is_in_buffer) {
|
||||||
void* tmpptr = ptr;
|
void* tmpptr = ptr;
|
||||||
other.oper_ptr->move(&other.buffer, &buffer);
|
other.oper_ptr->move(&other.buffer, &buffer);
|
||||||
oper_ptr->move(&tmpptr, &other.ptr);
|
other.ptr = tmpptr;
|
||||||
} else {
|
} else {
|
||||||
std::swap(ptr, other.ptr);
|
std::swap(ptr, other.ptr);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue