On Overload Jouranl for this month I found an article about how to design Observer pattern with C++11. You'll find it here. The reading is interesting but I found a piece of code using std::atomic
I don't really understand.
What is the meaning of function next
below? It doesn't even seem a function declaration (no return
keyword). I am using g++ 4.7.2
#include <iostream>
#include <cstddef>
#include <atomic>
struct ListItem {
ListItem() {}
...
atomic<ListItem*> next{nullptr};
~ListItem() { delete next.load(); }
};