Я не понимаю какой-то код в singly_linked.hpp :
template <class T>
struct singly_linked {
// -- member types -----------------------------------------------------------
/// The type for dummy nodes in singly linked lists.
using node_type = singly_linked<T>; // exactly type of node_type???
/// Type of the pointer connecting two singly linked nodes.
using node_pointer = node_type*;
// -- constructors, destructors, and assignment operators --------------------
singly_linked(node_pointer n = nullptr) : next(n) {
// nop
}
// -- member variables -------------------------------------------------------
/// Intrusive pointer to the next element.
node_pointer next;
};
что именно является типом node_type
?Это вызывает бесконечный цикл?Например, если у меня есть:
singly_linked<int> node;
, то какой тип singly_linked<int>::node_type
?