163 for (
size_t i = 0; i < n; ++i)
241 return array.put(data);
252 return array.put(std::forward<T>(data));
276 return array.push(data);
288 return array.push(std::forward<T>(data));
317 return *
array.get_ptr();
323 return *
array.get_ptr();
396 for (
size_t i = 0; i < n; ++i)
412 template<
class Operation>
419 template<
class Operation>
426 template<
class Operation>
433 template<
class Operation>
456template<
typename T,
typename ...
Args>
462template <
class Container>
463inline std::vector<typename Container::Item_Type>
466 std::vector<typename Container::Item_Type>
ret(c.size());
467 for (
size_t i = 0; i < c.size(); ++i)
Variadic constructor macros for containers.
#define Args_Ctor(Name, Type)
Container traversal and functional operation mixins.
#define ah_underflow_error_if(C)
Throws std::underflow_error if condition holds.
#define Special_Ctors(Set_Type, Type)
Generates special constructors for containers.
Core header for the Aleph-w library.
Simple dynamic array with automatic resizing and functional operations.
constexpr const T & operator()(const size_t i) const noexcept
Return a constant reference to the ith element. It does not perform bound_statics checks.
Array & operator=(Array &&s) noexcept
Assign by moving s to this
static Array create(size_t n)
Create an array with n logical elements.
constexpr size_t size() const noexcept
Return the number of elements stored in the stack.
void empty() noexcept
Empty the stack.
T & append(T &&data)
Append data
constexpr bool is_empty() const noexcept
Return true if stack is empty.
Array(size_t dim=32)
The type of key.
bool traverse(Operation &&operation=Operation()) const
bool traverse(Operation &operation) const
Array(const Array &s)
Copy constructor.
T & base()
Return a reference to the first element of array.
T Key_Type
The type of element.
T & insert(const T &data)
insert a copy of data at the beginning of the array.
bool traverse(Operation &&operation=Operation())
Array(Array &&s) noexcept
Move constructor.
void swap(Array &s) noexcept
Swap this with s
T & append(const T &data)
Append a copy of data
Array append(const Array &a) const
Array & operator=(const Array &s)
Assign by copy s to this
bool traverse(Operation &operation)
Traverse all the items of the stack from the youngest to the oldest and conditionally performs an ope...
Array & append(const Array &a)
const T & get_first() const noexcept
return a constant reference to the first element.
T & insert(T &&data)
insert a copy of data at the beginning of the array.
T & operator[](size_t i)
Return a reference to the ith element.
T & get_first() noexcept
return a modifiable reference to the first element.
Array(size_t n, const T &value)
Construct an array with n copies of value.
const T & operator[](size_t i) const
Return a constant reference to the ith element.
constexpr T & operator()(const size_t i) noexcept
Return a reference to the ith element. It does not perform bound_statics checks.
Array & reverse()
Reverse the order of items in array.
bool is_valid() const noexcept
const T & get_last() const noexcept
return a constant reference to the last element.
T & get_last() noexcept
return a modifiable reference to the last element.
constexpr size_t capacity() const noexcept
Return the internal capacity.
Array reverse() const
Return a copy of this with its items reversed.
void reserve(size_t cap)
Reserves cap cells into the array.
void putn(const size_t n)
Reserve n additional logical slots in the array without value-initializing them.
Simple, scalable and fast dynamic array.
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.
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_dim_function > > dim(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
Singly linked list implementations with head-tail access.
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
Array< T > build_array(Args ... args)
std::vector< typename Container::Item_Type > to_stdvector(const Container &c)
DynList< T > maps(const C &c, Op op)
Classic map operation.
Iterator on the items of an array.
Iterator(const Array< T > &s) noexcept
Initialize an iterator on array s
typename MemArray< T >::Iterator Base
Simple iterator on elements of array.
Generic list of items stored in a container.
Dynamic doubly linked list implementation.
Simple, scalable, contiguous dynamic array.