ORIGINAL
|
A base class for iterable containers that support iterators. More...
#include <iterable.h>
Classes | |
class | iterAdaptor |
An iterator adapter for the iterable container. More... | |
Public Member Functions | |
iterAdaptor | begin () |
Returns an iterator pointing to the beginning of the iterable container. | |
iterAdaptor | end () |
Returns an iterator pointing to the end of the iterable container. | |
iterAdaptor | begin () const |
Returns a constant iterator pointing to the beginning of the iterable container. | |
iterAdaptor | end () const |
Returns a constant iterator pointing to the end of the iterable container. | |
iterAdaptor | first () |
Returns an iterator pointing to the first element. | |
iterAdaptor | last () |
Returns an iterator pointing to the last element. | |
iterAdaptor | first () const |
Returns a constant iterator pointing to the first element. | |
iterAdaptor | last () const |
Returns a constant iterator pointing to the last element. | |
virtual baseIterator< TYPE > * | begins () const =0 |
Returns the iterator to the beginning of the container. | |
virtual baseIterator< TYPE > * | ends () const =0 |
Returns the iterator to the end of the container. | |
template<typename Callback = transform<TYPE>> requires Operation<Callback, TYPE> | |
void | forEach (Callback operation=Callback{}) |
Applies a given operation to each element in the iterable container. | |
template<typename Callback = transform<TYPE>> requires Operation<Callback, TYPE> | |
void | forEach (const Callback &operation=Callback{}) const |
Applies a given operation to each element in the iterable container (const version). | |
template<typename Callback> requires original::Operation<Callback, TYPE> | |
auto | forEach (Callback operation) -> void |
template<typename Callback> requires original::Operation<Callback, TYPE> | |
auto | forEach (const Callback &operation) const -> void |
A base class for iterable containers that support iterators.
TYPE | The type of elements contained in the iterable. |
This class defines the iterable
container interface, which provides methods for obtaining iterators and applying operations on elements using iterators. It also supports iteration using C++ range-based for loops by providing begin()
and end()
methods.
auto original::iterable< TYPE >::begin | ( | ) |
Returns an iterator pointing to the beginning of the iterable container.
This function allows using the range-based for
loop syntax.
auto original::iterable< TYPE >::begin | ( | ) | const |
Returns a constant iterator pointing to the beginning of the iterable container.
This function allows using the range-based for
loop syntax.
|
pure virtual |
Returns the iterator to the beginning of the container.
This method is used internally by begin()
, but can be accessed directly for other purposes.
Implemented in original::array< TYPE, ALLOC >, original::array< underlying_type, rebind_alloc_underlying >, original::bitSet< ALLOC >, original::blocksList< TYPE, ALLOC >, original::blocksList< TYPE, allocator< TYPE > >, original::chain< TYPE, ALLOC >, original::chain< opts >, original::chain< original::strongPtr< original::filter< TYPE > > >, original::chain< original::strongPtr< original::transform< TYPE > > >, original::chain< TYPE, allocator< TYPE > >, original::forwardChain< TYPE, ALLOC >, original::vector< TYPE, ALLOC >, and original::vector< TYPE * >.
auto original::iterable< TYPE >::end | ( | ) |
Returns an iterator pointing to the end of the iterable container.
This function allows using the range-based for
loop syntax.
auto original::iterable< TYPE >::end | ( | ) | const |
Returns a constant iterator pointing to the end of the iterable container.
This function allows using the range-based for
loop syntax.
|
pure virtual |
Returns the iterator to the end of the container.
This method is used internally by end()
, but can be accessed directly for other purposes.
Implemented in original::array< TYPE, ALLOC >, original::array< underlying_type, rebind_alloc_underlying >, original::bitSet< ALLOC >, original::blocksList< TYPE, ALLOC >, original::blocksList< TYPE, allocator< TYPE > >, original::chain< TYPE, ALLOC >, original::chain< opts >, original::chain< original::strongPtr< original::filter< TYPE > > >, original::chain< original::strongPtr< original::transform< TYPE > > >, original::chain< TYPE, allocator< TYPE > >, original::forwardChain< TYPE, ALLOC >, original::vector< TYPE, ALLOC >, and original::vector< TYPE * >.
auto original::iterable< TYPE >::first | ( | ) |
Returns an iterator pointing to the first element.
auto original::iterable< TYPE >::first | ( | ) | const |
Returns a constant iterator pointing to the first element.
void original::iterable< TYPE >::forEach | ( | Callback | operation = Callback{} | ) |
Applies a given operation to each element in the iterable container.
Callback | A callable object that defines the operation to be applied to each element. |
operation | The operation to be applied. |
void original::iterable< TYPE >::forEach | ( | const Callback & | operation = Callback{} | ) | const |
Applies a given operation to each element in the iterable container (const version).
Callback | A callable object that defines the operation to be applied to each element. |
operation | The operation to be applied. |
auto original::iterable< TYPE >::last | ( | ) |
Returns an iterator pointing to the last element.
auto original::iterable< TYPE >::last | ( | ) | const |
Returns a constant iterator pointing to the last element.