Commit 30a2a543 authored by Dominik Charousset's avatar Dominik Charousset

Fix noexcept warning on GCC

parent 8598816e
......@@ -160,7 +160,7 @@ public:
/// Closes this inbox and moves all elements to the queue.
/// @warning Call only from the reader (owner).
void close() {
auto f = [&](pointer x) {
auto f = [&](pointer x) noexcept {
queue_.lifo_append(x);
};
inbox_.close(f);
......
......@@ -168,7 +168,7 @@ public:
/// `f` must take ownership of the passed pointer.
/// @warning Call only from the reader (owner).
template <class F>
void close(F& f) noexcept(noexcept(f(std::declval<pointer>()))) {
void close(F& f) noexcept {
node_pointer ptr = take_head(stack_closed_tag());
while (ptr != nullptr) {
auto next = ptr->next;
......
......@@ -36,7 +36,11 @@ struct singly_linked {
// -- constructors, destructors, and assignment operators --------------------
singly_linked(node_pointer n = nullptr) : next(n) {
singly_linked() noexcept : next(nullptr) {
// nop
}
explicit singly_linked(node_pointer n) noexcept : next(n) {
// nop
}
......@@ -48,13 +52,13 @@ struct singly_linked {
/// Casts a node type to its value type.
template <class T>
T* promote(singly_linked<T>* ptr) {
T* promote(singly_linked<T>* ptr) noexcept {
return static_cast<T*>(ptr);
}
/// Casts a node type to its value type.
template <class T>
const T* promote(const singly_linked<T>* ptr) {
const T* promote(const singly_linked<T>* ptr) noexcept {
return static_cast<const T*>(ptr);
}
......
......@@ -69,7 +69,7 @@ public:
init();
}
task_queue(task_queue&& other) : task_queue(other.policy()) {
task_queue(task_queue&& other) noexcept : task_queue(other.policy()) {
if (other.empty()) {
init();
} else {
......@@ -81,7 +81,7 @@ public:
}
}
task_queue& operator=(task_queue&& other) {
task_queue& operator=(task_queue&& other) noexcept {
deinit();
if (other.empty()) {
init();
......@@ -261,7 +261,7 @@ public:
/// Transfers all element from `other` to the front of this queue.
template <class Container>
void prepend(Container& other) {
void prepend(Container& other) noexcept {
if (other.empty())
return;
if (empty()) {
......@@ -276,7 +276,7 @@ public:
/// Transfers all element from `other` to the back of this queue.
template <class Container>
void append(Container& other) {
void append(Container& other) noexcept {
if (other.empty())
return;
if (empty()) {
......@@ -296,7 +296,7 @@ public:
/// @warning leaves the queue in an invalid state until calling
/// `stop_lifo_append`.
/// @private
void lifo_append(node_pointer ptr) {
void lifo_append(node_pointer ptr) noexcept {
if (old_last_ == nullptr) {
old_last_ = back();
push_back(promote(ptr));
......
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 to comment