8#ifndef HPP_ALIB_BOXING_FUNCTIONDEFS
9#define HPP_ALIB_BOXING_FUNCTIONDEFS 1
11#if !defined(HPP_ALIB_BOXING_BOXING)
12# error "ALib sources with ending '.inl' must not be included from outside."
15namespace alib {
namespace boxing {
19 template<
typename TComparable>
22 if( !rhsBox.IsType<TComparable >() )
25 return self.Unbox<TComparable>() == rhsBox.Unbox<TComparable>();
28template<
typename TComparableP>
31 if( !rhsBox.IsType<TComparableP>() )
34 auto lhs= self .Unbox<TComparableP>();
35 auto rhs= rhsBox.Unbox<TComparableP>();
37 return rhs ==
nullptr;
45template<
typename TComparable>
48 if( !rhsBox.IsType<TComparable >() )
49 return std::type_index( self.TypeID() ) < std::type_index( rhsBox.TypeID() );
51 return self.Unbox<TComparable>() < rhsBox.Unbox<TComparable>();
54template<
typename TComparableP>
57 if( !rhsBox.IsType<TComparableP>() )
60 auto lhs= self .Unbox<TComparableP>();
61 auto rhs= rhsBox.Unbox<TComparableP>();
63 return rhs !=
nullptr;
77 "Hash function registered with type of wrong usage length")
79 size_t result= std::size_t(0x52a6937UL) - (N * 0x387e)
80 + std::size_t( self.
TypeID().hash_code() );
85 if constexpr( N <
sizeof(
uinteger ) )
87 & ((Bit1 << (N * 8) )- 1) ) * 92334534 )
93 if constexpr ( N ==
sizeof(
uinteger) )
100 & ((Bit1 << ((N -
sizeof(
uinteger)) * 8) )- 1) ) * 892112 )
108#if ALIB_STRINGS && !defined(ALIB_DOX)
109template<
typename TChar>
110template<
typename TAppendable>
114 target.template Append<false>( self.
Unbox<TAppendable>() );
117template<
typename TChar>
118template<
typename TAppendable>
122 auto pointer= self.
Unbox<TAppendable>();
124 target.template Append<false>( *pointer );
128 target << self.
TypeID() <<
"(nullptr)";
130 target <<
"(nullptr)";
135template<
typename TChar>
136template<
typename TAppendable>
139 target.template _<false>( self.Unbox<std::reference_wrapper<TAppendable>>().get() );
unsigned int GetPlaceholderUsageLength() const
const std::type_info & TypeID() const
const Placeholder & Data() const
const TUnboxable Unbox() const
#define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW
#define ATMP_VOID_IF(Cond)
#define ALIB_WARNINGS_RESTORE
#define ALIB_ASSERT_ERROR(cond,...)
#define ATMP_T_IF(T, Cond)
lang::uinteger uinteger
Type alias in namespace alib.
boxing::Box Box
Type alias in namespace alib.
static void WrappedAppendable(const Box &self, strings::TAString< TChar > &target)
static void Appendable(const Box &self, strings::TAString< TChar > &target)
static bool ComparableTypes(const Box &self, const Box &rhs)
static size_t UsePlaceholderBytes(const Box &self)
static bool ComparableTypes(const Box &self, const Box &rhs)
constexpr uinteger GetUInteger(int idx) const