Код: Выделить всё
struct base_node {
base_node* _next = nullptr;
};
template
struct node: base_node {
T _value;
node() = default;
explicit node(const T& v) : _value(v) {}
explicit node(T&& v) : _value(std::move(v)) {}
};
Код: Выделить всё
template
class base_iterator {
using base_node_t = std::conditional_t;
using node_t = std::conditional_t;
Код: Выделить всё
using iterator = base_iterator;
using const_iterator = base_iterator;
Код: Выделить всё
iterator insert_after(const_iterator pos, const_reference value) {
// ????? we need used const_cast??
}
Подробнее здесь: https://stackoverflow.com/questions/799 ... ementation