57template <
typename T>
class Array_Container;
90 <<
"Array_Iterator(): ptr == nullptr with dim > 0";
96 <<
"Array_Iterator(): num_items greater than dim";
107 return n == 0 ? 0 :
static_cast<long>(n - 1);
185 <<
"Array_Iterator(): dim == 0 but num_items > 0";
248 <<
"Array_Iterator::get_curr(): no current item";
251 <<
"Array_Iterator::get_curr(): no current item";
272 <<
"Array_Iterator::next(): no current item";
292 <<
"Array_Iterator::prev(): no current item";
419 <<
"Array_Container::get_first(): n == 0";
430 <<
"Array_Container::get_last(): n == 0";
Exception handling system with formatted messages for Aleph-w.
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
#define ah_overflow_error_if(C)
Throws std::overflow_error if condition holds.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
#define ah_invalid_argument_if(C)
Throws std::invalid_argument if condition holds.
Core definitions, constants, and utility macros for Aleph-w.
NoExceptionCtor
Tag type for no-exception construction.
Core header for the Aleph-w library.
void put_itor_at_the_end(Itor &it) noexcept
Lightweight wrapper that provides Aleph-w container interface for raw arrays.
T * get_base() const noexcept
Get the base pointer.
T & get_last() const
Get the last element.
T Item_Type
The type of elements in the container.
constexpr size_t capacity() const noexcept
Get the capacity.
T & get_first() const
Get the first element.
Array_Container(T *base_ptr, const size_t d)
Construct a container wrapping a raw array.
Iterator get_it() const
Get an iterator to the beginning.
constexpr size_t size() const noexcept
Get the number of elements.
constexpr bool is_empty() const noexcept
Check if the container is empty.
Iterator wrapper for C++ raw arrays.
void next_ne() noexcept
Advance to the next item without bounds checking.
T & get_curr() const
Get the current item with bounds checking.
Array_Iterator(NoExceptionCtor, T *p, const size_t sz, const size_t n)
Construct an iterator without exception checking.
void reset_last() noexcept
Reset the iterator to the last item.
Array_Iterator(const Array_Container< T > &c)
Construct an iterator from an Array_Container.
void reset() noexcept
Reset the iterator to the first item.
Array_Iterator()=default
Default constructor - creates an invalid iterator.
T Item_Type
The type of elements being iterated.
T & get_curr_ne() const noexcept
Get the current item without bounds checking.
constexpr const T * get_base() const noexcept
Get the base pointer of the array (const version).
Array_Iterator(T *p, const size_t sz, const size_t n)
Construct an iterator over an array.
T * get_base() noexcept
Get the base pointer of the array.
Array_Iterator(NoExceptionCtor, T *p, const size_t sz, const size_t n, const long f, const long l)
Construct a circular iterator without exception checking.
void end() noexcept
Put the iterator at the end (past the last item).
Array_Iterator(T *p, const size_t sz, const size_t n, const long f, const long l)
Construct an iterator over a circular array region.
void prev()
Move to the previous item with bounds checking.
void prev_ne() noexcept
Move to the previous item without bounds checking.
void next()
Advance to the next item with bounds checking.
void reset_first() noexcept
Reset the iterator to the first item (alias for reset()).
bool has_curr() const noexcept
Check if there is a current valid item.
bool is_last() const noexcept
Check if positioned at the last item.
constexpr long get_pos() const noexcept
Get the current position index.
Equality test for containers.
Common methods to the Aleph-w ( ) containers.
Aleph::DynList< __T > maps(Operation &op) const
Map the elements of the container.
Common sequential searching methods on containers.
Mixin that adds STL begin()/end() and cbegin()/cend() to Aleph containers.
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
size_t size(Node *root) noexcept
Array_Container< T > make_array_container(T *array, size_t n)
Create an Array_Container from a raw array.
std::decay_t< typename HeadC::Item_Type > T
Array_Iterator< T > get_array_it(const T *array, size_t n)
Create an iterator for a raw array.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Iterator type for Array_Container.
Iterator(const Array_Container &c)
Construct an iterator for the given container.
Generic list of items stored in a container.
Generic traversal of the container through its iterator.