1#ifndef ITERATIONSTREAM_H
2#define ITERATIONSTREAM_H
32 template<
typename TYPE,
typename DERIVED>
60 [[nodiscard]] std::string
className()
const override;
70 [[nodiscard]] std::string
toString(
bool enter)
const override;
74template<
typename TYPE,
typename DERIVED>
80 for (
const auto it = this->
begin(); it.isValid(); ++it) {
91template<
typename TYPE,
typename DERIVED>
93 const auto this_it = this->
begin();
94 const auto other_it = other.begin();
95 for (; this_it.isValid() && other_it.isValid(); ++this_it, ++other_it) {
97 if (*this_it != *other_it)
98 return *this_it < *other_it ? -1 : 1;
101 return this_it.isValid() - other_it.isValid();
104template<
typename TYPE,
typename DERIVED>
106 return "iterationStream";
109template<
typename TYPE,
typename DERIVED>
112 std::stringstream ss;
114 if (enter) ss <<
"\n";
Base class for comparable objects.
Definition comparable.h:31
A base class for iterable containers that support iterators.
Definition iterable.h:32
iterAdaptor first()
Returns an iterator pointing to the first element.
Definition iterable.h:472
iterAdaptor begin()
Returns an iterator pointing to the beginning of the iterable container.
Definition iterable.h:448
A stream class that allows iteration, comparison, and printing.
Definition iterationStream.h:33
std::string elementsString() const
Returns a string representation of the elements in the stream.
Definition iterationStream.h:75
integer compareTo(const iterationStream &other) const override
Compares the current iteration stream with another iteration stream.
Definition iterationStream.h:92
std::string className() const override
Returns the class name.
Definition iterationStream.h:105
std::string toString(bool enter) const override
Converts the iteration stream to a string representation.
Definition iterationStream.h:110
Base class providing polymorphic string conversion capabilities.
Definition printable.h:25
static std::string formatString(const TYPE &t)
Universal value-to-string conversion.
Interface for objects that can be compared.
Requires type to support all comparison operators.
Definition types.h:29
Base interface for iterable container types.
Main namespace for the project Original.
Definition algorithms.h:21
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:15
Interface for polymorphic string formatting and output.
Type system foundations and concept definitions.