35 template<
typename F_TYPE,
typename S_TYPE>
96 template<u_
integer IDX>
106 template<u_
integer IDX>
116 template<u_
integer IDX,
typename T>
167 [[nodiscard]] std::string
toString(
bool enter)
const override;
178 template<
typename F,
typename S>
179 struct tuple_size<
original::couple<F, S>> : std::integral_constant<std::size_t, 2> {};
187 template<std::
size_t I,
typename F,
typename S>
189 using type = std::conditional_t<I == 0, F, S>;
201 template<std::
size_t I,
typename F,
typename S>
213 template<std::
size_t I,
typename F,
typename S>
225 template<std::
size_t I,
typename F,
typename S>
230 template <
typename F_TYPE,
typename S_TYPE>
233 template <
typename F_TYPE,
typename S_TYPE>
237 template <
typename F_TYPE,
typename S_TYPE>
241 template <
typename F_TYPE,
typename S_TYPE>
243 : first_(other.first_), second_(other.second_) {}
245 template <
typename F_TYPE,
typename S_TYPE>
248 if (
this == &other)
return *
this;
249 first_ = other.first_;
250 second_ = other.second_;
254 template<
typename F_TYPE,
typename S_TYPE>
256 : first_(std::move(other.first_)), second_(std::move(other.second_)) {}
258 template<
typename F_TYPE,
typename S_TYPE>
261 if (
this == &other)
return *
this;
263 first_ = std::move(other.first_);
264 second_ = std::move(other.second_);
268 template<
typename F_TYPE,
typename S_TYPE>
269 template<original::u_
integer IDX>
272 if constexpr (IDX == 0){
275 return this->second_;
279 template<
typename F_TYPE,
typename S_TYPE>
280 template<original::u_
integer IDX>
283 if constexpr (IDX == 0){
286 return this->second_;
290 template<
typename F_TYPE,
typename S_TYPE>
291 template<original::u_
integer IDX,
typename T>
294 if constexpr (IDX == 0){
295 staticError<valueError, !std::is_convertible_v<T, F_TYPE>>{};
296 this->first_ =
static_cast<F_TYPE
>(e);
299 this->second_ =
static_cast<S_TYPE
>(e);
304 template<
typename F_TYPE,
typename S_TYPE>
308 if (this->first_ < other.first_)
310 if (this->first_ > other.first_)
314 if (this->second_ < other.second_)
316 if (this->second_ > other.second_)
322 template <
typename F_TYPE,
typename S_TYPE>
328 template <
typename F_TYPE,
typename S_TYPE>
331 return this->second_;
334 template<
typename F_TYPE,
typename S_TYPE>
339 template<
typename F_TYPE,
typename S_TYPE>
341 return this->second_;
344template <
typename F_TYPE,
typename S_TYPE>
347 template <
typename F_TYPE,
typename S_TYPE>
353 template <
typename F_TYPE,
typename S_TYPE>
356 std::stringstream ss;
359 if (enter) ss <<
"\n";
363 template<std::
size_t I,
typename F,
typename S>
365 return c.template
get<I>();
368 template<std::
size_t I,
typename F,
typename S>
370 return c.template
get<I>();
373 template<std::
size_t I,
typename F,
typename S>
375 return std::move(c.template
get<I>());
Base class for comparable objects.
Definition comparable.h:31
Container for two heterogeneous elements.
Definition couple.h:37
const auto & get() const
Element access template method (const version)
Definition couple.h:281
std::string className() const override
Gets class name identifier.
Definition couple.h:348
std::string toString(bool enter) const override
Formats pair elements as string.
Definition couple.h:354
~couple() override
Default destructor.
const K_TYPE & first()
Definition couple.h:323
V_TYPE & second()
Definition couple.h:329
const F_TYPE & first() const
Access first element (const version)
Definition couple.h:335
couple & operator=(couple &&other) noexcept
Move assignment operator.
Definition couple.h:260
couple(couple &&other) noexcept
Move constructor.
Definition couple.h:255
couple(const F_TYPE &first, const S_TYPE &second)
Constructs from element copies.
Definition couple.h:238
auto & get()
Element access template method (non-const version)
Definition couple.h:270
couple & operator=(const couple &other)
Copy assignment operator.
Definition couple.h:246
couple & set(const T &e)
element modifies the template method
couple()
Default constructs both elements.
Definition couple.h:231
couple(const couple &other)
Copy constructor.
Definition couple.h:242
const S_TYPE & second() const
Access second element (const version)
Definition couple.h:340
integer compareTo(const couple &other) const override
Lexicographical comparison operation.
Definition couple.h:305
couple(F_TYPE *first, S_TYPE *second)
Constructs from pointer elements.
Definition couple.h:234
Exception for container index out-of-range errors.
Definition error.h:84
Base class providing polymorphic string conversion capabilities.
Definition printable.h:29
static std::string formatString(const TYPE &t)
Universal value-to-string conversion.
Compile-time error assertion utility.
Definition error.h:73
Interface for objects that can be compared.
Requires type to support all comparison operators.
Definition types.h:45
constexpr auto & get(original::couple< F, S > &c) noexcept
Structured binding support - get for non-const lvalue reference.
Definition couple.h:364
Custom exception classes and callback validation utilities.
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:35
Interface for polymorphic string formatting and output.
Core type system foundations and concept definitions.