35 template<
typename F_TYPE,
typename S_TYPE>
98 template<u_
integer IDX>
108 template<u_
integer IDX>
118 template<u_
integer IDX,
typename T>
169 [[nodiscard]] std::string
toString(
bool enter)
const override;
180 template<
typename F,
typename S>
181 struct tuple_size<
original::couple<F, S>> : std::integral_constant<std::size_t, 2> {};
189 template<std::
size_t I,
typename F,
typename S>
191 using type = std::conditional_t<I == 0, F, S>;
203 template<std::
size_t I,
typename F,
typename S>
215 template<std::
size_t I,
typename F,
typename S>
227 template<std::
size_t I,
typename F,
typename S>
232 template <
typename F_TYPE,
typename S_TYPE>
235 template <
typename F_TYPE,
typename S_TYPE>
237 : first_(*first), second_(*second) {}
239 template <
typename F_TYPE,
typename S_TYPE>
241 : first_(first), second_(second) {}
243 template <
typename F_TYPE,
typename S_TYPE>
245 : first_(std::move(first)), second_(std::move(second)) {}
247 template <
typename F_TYPE,
typename S_TYPE>
249 : first_(other.first_), second_(other.second_) {}
251 template <
typename F_TYPE,
typename S_TYPE>
254 if (
this == &other)
return *
this;
255 first_ = other.first_;
256 second_ = other.second_;
260 template<
typename F_TYPE,
typename S_TYPE>
262 : first_(std::move(other.first_)), second_(std::move(other.second_)) {}
264 template<
typename F_TYPE,
typename S_TYPE>
267 if (
this == &other)
return *
this;
269 first_ = std::move(other.first_);
270 second_ = std::move(other.second_);
274 template<
typename F_TYPE,
typename S_TYPE>
275 template<original::u_
integer IDX>
278 if constexpr (IDX == 0){
281 return this->second_;
285 template<
typename F_TYPE,
typename S_TYPE>
286 template<original::u_
integer IDX>
289 if constexpr (IDX == 0){
292 return this->second_;
296 template<
typename F_TYPE,
typename S_TYPE>
297 template<original::u_
integer IDX,
typename T>
300 if constexpr (IDX == 0){
302 this->first_ =
static_cast<F_TYPE
>(e);
304 staticError<valueError, !std::is_convertible_v<T, S_TYPE>>::asserts();
305 this->second_ =
static_cast<S_TYPE
>(e);
310 template<
typename F_TYPE,
typename S_TYPE>
314 if (this->first_ < other.first_)
316 if (this->first_ > other.first_)
320 if (this->second_ < other.second_)
322 if (this->second_ > other.second_)
328 template <
typename F_TYPE,
typename S_TYPE>
334 template <
typename F_TYPE,
typename S_TYPE>
337 return this->second_;
340 template<
typename F_TYPE,
typename S_TYPE>
345 template<
typename F_TYPE,
typename S_TYPE>
347 return this->second_;
350template <
typename F_TYPE,
typename S_TYPE>
353 template <
typename F_TYPE,
typename S_TYPE>
359 template <
typename F_TYPE,
typename S_TYPE>
362 std::stringstream ss;
363 ss << this->className() <<
"(" << formatString(this->first_)
364 <<
", " << formatString(this->second_) <<
")";
365 if (enter) ss <<
"\n";
369 template<std::
size_t I,
typename F,
typename S>
371 return c.template get<I>();
374 template<std::
size_t I,
typename F,
typename S>
376 return c.template get<I>();
379 template<std::
size_t I,
typename F,
typename S>
381 return std::move(c.template get<I>());
Base class for comparable objects.
Definition comparable.h:32
Container for two heterogeneous elements.
Definition couple.h:37
const auto & get() const
Element access template method (const version)
Definition couple.h:287
std::string className() const override
Gets class name identifier.
Definition couple.h:354
std::string toString(bool enter) const override
Formats pair elements as string.
Definition couple.h:360
~couple() override
Default destructor.
F_TYPE & first()
Access first element.
Definition couple.h:329
S_TYPE & second()
Access second element.
Definition couple.h:335
const F_TYPE & first() const
Access first element (const version)
Definition couple.h:341
couple & operator=(couple &&other) noexcept
Move assignment operator.
Definition couple.h:266
couple(couple &&other) noexcept
Move constructor.
Definition couple.h:261
couple(const F_TYPE &first, const S_TYPE &second)
Constructs from element copies.
Definition couple.h:240
auto & get()
Element access template method (non-const version)
Definition couple.h:276
couple & operator=(const couple &other)
Copy assignment operator.
Definition couple.h:252
couple & set(const T &e)
element modifies the template method
couple()
Default constructs both elements.
Definition couple.h:233
couple(const couple &other)
Copy constructor.
Definition couple.h:248
const S_TYPE & second() const
Access second element (const version)
Definition couple.h:346
integer compareTo(const couple &other) const override
Lexicographical comparison operation.
Definition couple.h:311
couple(F_TYPE *first, S_TYPE *second)
Constructs from pointer elements.
Definition couple.h:236
Exception for container index out-of-range errors.
Definition error.h:129
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39
Compile-time error triggering utility.
Definition error.h:112
Interface for objects that can be compared.
constexpr auto & get(original::couple< F, S > &c) noexcept
Structured binding support - get for non-const lvalue reference.
Definition couple.h:370
Custom exception classes and callback validation utilities.
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
Main namespace for the project Original.
Definition algorithms.h:21
Interface for polymorphic string formatting and output.
Core type system foundations and concept definitions.