Commit 1b4c5880 by FritzFlorian

Add further type-safety check to work_stealing_deque.

parent 98ae70bb
Pipeline #1191 passed with stages
in 3 minutes 46 seconds
......@@ -85,7 +85,7 @@ class work_stealing_deque {
std::pair<work_stealing_deque_item, T> *allocate_item(const T &new_item);
template<typename T>
Item *push_tail(const T &new_item);
T *push_tail(const T &new_item);
Item *pop_tail();
Item *pop_head();
......
......@@ -38,7 +38,10 @@ std::pair<work_stealing_deque_item, T> *work_stealing_deque<Item>::allocate_item
template<typename Item>
template<typename T>
Item *work_stealing_deque<Item>::push_tail(const T &new_item) {
T *work_stealing_deque<Item>::push_tail(const T &new_item) {
static_assert(std::is_same<Item, T>::value || std::is_base_of<Item, T>::value,
"Must only push types of <Item> onto work_stealing_deque<Item>");
offset_t local_tail = tail_;
auto new_pair = allocate_item(new_item);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment