39# ifndef TPL_DYN_SLIST_NC_H
40# define TPL_DYN_SLIST_NC_H
255 return Node::Iterator::get_curr()->get_data();
260 return Node::Iterator::get_curr()->get_data();
318 for (
size_t i = 0; i < n; ++i, it.
next_ne());
332 for (
size_t i = 0; i < n; ++i, it.
next_ne());
Exception handling system with formatted messages for Aleph-w.
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
#define ah_range_error_if(C)
Throws std::range_error if condition holds.
Iterator for Dyn_Slist_Nc.
Iterator(Dyn_Slist_Nc< T > &list)
T & get_curr_n() const noexcept
Dynamic list of elements of type T.
void clear() noexcept
Alias for empty().
T & rear()
If this is a queue, returns the youngest element.
T remove_first()
Removes the first element of the list and returns a copy of it.
T pop()
If this is a stack, removes the top element.
T & operator[](const size_t &n)
Access element at index n.
Dyn_Slist_Nc(const Dyn_Slist_Nc &l)
Copy constructor.
T & front()
If this is a queue, returns the oldest element.
T & get_first()
Returns a reference to the first element of the list.
T & insert(const T &data)
Insert an element at the beginning of the list.
T & put(const T &item)
If this is a queue, inserts the item item.
T & top()
If this is a stack, returns the top element.
const T & front() const
Returns a reference to the oldest element (const version).
T & push(const T &item)
If this is a stack, inserts the item item.
const T & top() const
Returns the top element (const version).
const size_t & size() const
Returns the number of elements in the list.
T & get_last()
Returns a reference to the last element of the list.
T get()
If this is a queue, extracts the oldest element.
Dyn_Slist_Nc()
Default constructor.
T & append(const T &data)
Append an element at the end of the list.
void empty()
Empties the container.
Dyn_Slist_Nc & operator=(const Dyn_Slist_Nc &list)
Assignment operator with lvalue semantics.
~Dyn_Slist_Nc()
Destructor.
const T & get_last() const
Returns a reference to the last element of the list (const version).
const T & get_first() const
Returns a reference to the first element of the list (const version).
const T & rear() const
Returns a reference to the youngest element (const version).
void next_ne() noexcept
Advances iterator by one position.
void reset()
Resets the link to nullptr.
bool is_empty() const
Returns true if this is empty (points to nullptr).
void insert(Slink_Nc *p)
Inserts link p after this.
Snode_Nc * remove_next()
Removes the node following this.
Snode_Nc *& get_next()
Returns the node following this.
T & get_data()
Returns a reference to the data contained in the node.
Main namespace for Aleph-w library functions.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
Typed singly linked node (no check).