53 template<
typename F_TYPE,
typename S_TYPE>
127 template<u_
integer IDX>
137 template<u_
integer IDX>
148 template<u_
integer IDX,
typename T>
212 template<
typename F,
typename S>
220 template<
typename F,
typename S>
221 struct tuple_size<
original::couple<F, S>> : std::integral_constant<std::size_t, 2> {};
229 template<std::
size_t I,
typename F,
typename S>
231 using type = std::conditional_t<I == 0, F, S>;
243 template<std::
size_t I,
typename F,
typename S>
255 template<std::
size_t I,
typename F,
typename S>
267 template<std::
size_t I,
typename F,
typename S>
272 template <
typename F_TYPE,
typename S_TYPE>
275 template <
typename F_TYPE,
typename S_TYPE>
277 : first_(*first), second_(*second) {}
279 template <
typename F_TYPE,
typename S_TYPE>
281 : first_(first), second_(second) {}
283 template <
typename F_TYPE,
typename S_TYPE>
287 template <
typename F_TYPE,
typename S_TYPE>
289 : first_(
other.first_), second_(
other.second_) {}
291 template <
typename F_TYPE,
typename S_TYPE>
294 if (
this == &
other)
return *
this;
295 first_ =
other.first_;
296 second_ =
other.second_;
300 template<
typename F_TYPE,
typename S_TYPE>
302 : first_(std::move(
other.first_)), second_(std::move(
other.second_)) {}
304 template<
typename F_TYPE,
typename S_TYPE>
307 if (
this == &
other)
return *
this;
309 first_ = std::move(
other.first_);
310 second_ = std::move(
other.second_);
314 template <
typename F_TYPE,
typename S_TYPE>
324 template<
typename F_TYPE,
typename S_TYPE>
325 template<original::u_
integer IDX>
328 if constexpr (
IDX == 0){
331 return this->second_;
335 template<
typename F_TYPE,
typename S_TYPE>
336 template<original::u_
integer IDX>
339 if constexpr (
IDX == 0){
342 return this->second_;
346 template<
typename F_TYPE,
typename S_TYPE>
347 template<original::u_
integer IDX,
typename T>
350 if constexpr (
IDX == 0){
352 this->first_ =
static_cast<F_TYPE>(
e);
354 staticError<valueError, !std::is_convertible_v<T, S_TYPE>>::asserts();
355 this->second_ =
static_cast<S_TYPE
>(e);
360 template<
typename F_TYPE,
typename S_TYPE>
364 if (this->first_ <
other.first_)
366 if (this->first_ >
other.first_)
370 if (this->second_ <
other.second_)
372 if (this->second_ >
other.second_)
378 template <
typename F_TYPE,
typename S_TYPE>
384 template <
typename F_TYPE,
typename S_TYPE>
387 return this->second_;
390 template<
typename F_TYPE,
typename S_TYPE>
395 template<
typename F_TYPE,
typename S_TYPE>
397 return this->second_;
400template <
typename F_TYPE,
typename S_TYPE>
403 template <
typename F_TYPE,
typename S_TYPE>
409 template <
typename F_TYPE,
typename S_TYPE>
412 std::stringstream
ss;
413 ss << this->className() <<
"(" << formatString(this->first_)
414 <<
", " << formatString(this->second_) <<
")";
419 template <
typename F,
typename S>
425 template<std::
size_t I,
typename F,
typename S>
427 return c.template get<I>();
430 template<std::
size_t I,
typename F,
typename S>
432 return c.template get<I>();
435 template<std::
size_t I,
typename F,
typename S>
437 return std::move(c.template get<I>());
void swap(autoPtr &other) noexcept
Swaps the reference counters between two autoPtr instances.
Definition autoPtr.h:703
Base class for comparable objects.
Definition comparable.h:35
Container for two heterogeneous elements.
Definition couple.h:55
const auto & get() const
Element access template method (const version)
Definition couple.h:337
couple(F_TYPE &&first, S_TYPE &&second)
Constructs from rvalue references.
Definition couple.h:284
std::string className() const override
Gets class name identifier.
Definition couple.h:404
std::string toString(bool enter) const override
Formats pair elements as string.
Definition couple.h:410
~couple() override
Default destructor.
void swap(couple &other) noexcept
Swaps the contents of this couple with another.
Definition couple.h:315
F_TYPE & first()
Access first element.
Definition couple.h:379
S_TYPE & second()
Access second element.
Definition couple.h:385
const F_TYPE & first() const
Access first element (const version)
Definition couple.h:391
couple & operator=(couple &&other) noexcept
Move assignment operator.
Definition couple.h:306
couple(couple &&other) noexcept
Move constructor.
Definition couple.h:301
couple(const F_TYPE &first, const S_TYPE &second)
Constructs from element copies.
Definition couple.h:280
auto & get()
Element access template method (non-const version)
Definition couple.h:326
couple & operator=(const couple &other)
Copy assignment operator.
Definition couple.h:292
couple & set(const T &e)
Element modification template method.
couple()
Default constructs both elements.
Definition couple.h:273
couple(const couple &other)
Copy constructor.
Definition couple.h:288
const S_TYPE & second() const
Access second element (const version)
Definition couple.h:396
integer compareTo(const couple &other) const override
Lexicographical comparison operation.
Definition couple.h:361
couple(F_TYPE *first, S_TYPE *second)
Constructs from pointer elements.
Definition couple.h:276
Exception for container index out-of-range errors.
Definition error.h:192
Unique ownership smart pointer with move semantics.
Definition ownerPtr.h:37
Base class providing polymorphic string conversion capabilities.
Definition printable.h:39
Compile-time error triggering utility.
Definition error.h:167
Interface for objects that can be compared.
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
Standard namespace extensions for original::alternative.
Definition allocator.h:351
void swap(original::objPoolAllocator< TYPE > &lhs, original::objPoolAllocator< TYPE > &rhs) noexcept
Specialization of std::swap for objPoolAllocator.
Definition allocator.h:635
constexpr auto & get(original::couple< F, S > &c) noexcept
Structured binding support - get for non-const lvalue reference.
Definition couple.h:426
Interface for polymorphic string formatting and output.
Core type system foundations and concept definitions.