49 cout << it.get_curr() <<
" ";
51 cout <<
"size = " <<
l.
size() <<
" **" << endl;
66int main(
int argc,
char *argv[])
97 cerr <<
"Error: n and m must be positive integers." << endl;
101 unsigned int t = std::time(0);
117 cout << argv[0] <<
" " << n <<
" " <<
m <<
" " << t << endl;
122 for (i = 0; i < n; i++)
126 for (
int k = 0;
k <
m; ++
k)
135 cerr <<
"Error: List is empty, cannot get first element." << endl;
145 cout << it.get_curr() << endl;
154 l1.
for_each([] (
auto i) { cout << i <<
" "; }); cout << endl;
157 assert(
l1.
all([&i] (
auto k) { return k == i++; }));
Functional programming utilities for Aleph-w containers.
bool has_curr() const noexcept
Return true if the iterator has current item.
constexpr bool is_empty() const noexcept
Return true if this (as header node) is empty.
Dynamic doubly linked list with O(1) size and bidirectional access.
T & get_first()
Return a modifiable reference to first item in the list.
T & insert(const T &item)
Insert a copy of item at the beginning of the list.
T & append(const T &item)
size_t size() const noexcept
Return the number of items of the list, in constant time.
bool all(Operation &operation) const
Check if all the elements of the container satisfy a condition.
void for_each(Operation &operation) const
Traverse all the container and performs an operation on each element.
Singly linked list implementations with head-tail access.
Container< T > range(const T start, const T end, const T step=1)
Generate a range of values [start, end] with a given step.
FooMap m(5, fst_unit_pair_hash, snd_unit_pair_hash)
void imprime(DynDlist< int > &l)
Dynamic doubly linked list implementation.