160# define SLINK_TO_TYPE(type_name, link_name) \
161 static type_name * slink_to_type(Slink * link) \
163 type_name * ptr_zero = 0; \
164 size_t offset_link = (size_t) &(ptr_zero->link_name); \
165 unsigned long address_type = ((unsigned long) link) - offset_link; \
166 return (type_name *) address_type; \
Core header for the Aleph-w library.
Singly linked handle to list nodes.
void reset() noexcept
Reset the link so it points to itself.
Slink()
Default constructor.
void insert_next(Slink *p)
Insert link p right after this.
Slink * remove_next()
Remove the link right after this.
constexpr bool is_empty() const noexcept
Return true if this link is empty (points to itself).
constexpr Slink *& get_next() noexcept
Return the next link.
constexpr const Slink * get_next() const noexcept
Return the next link (const overload).
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.