8#ifndef HPP_ALIB_BOXING_ENUM
9#define HPP_ALIB_BOXING_ENUM 1
11#ifndef HPP_ALIB_BOXING_BOXING
15#if ALIB_ENUMS && !defined (HPP_ALIB_ENUMS_RECORDS)
19#if !defined (_GLIBCXX_TYPEINDEX) && !defined(_TYPEINDEX_)
23namespace alib {
namespace boxing {
59 #if !defined(ALIB_DOX)
79 template<
typename TEnum,
typename TEnableIf>
83 template<
typename TEnum,
84 typename TEnableIf =
typename std::enable_if<std::is_enum<TEnum>::value>::type >
100 template<
typename TEnum>
104 template<
typename TEnum>
150 #if defined(ALIB_DOX)
177 return static_cast<Box&
>(*this);
188 return static_cast<const Box&
>(*this);
192 #if defined(ALIB_DOX)
202 template<
typename TEnum>
206 template<
typename TEnum>
207 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
214 #if defined(ALIB_DOX)
222 template<
typename TEnum>
226 template<
typename TEnum>
227 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
230 return Integral() ==
static_cast<typename std::underlying_type<TEnum>::type
>( rhs )
235 #if defined(ALIB_DOX)
243 template<
typename TEnum>
247 template<
typename TEnum>
248 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
251 return Integral() !=
static_cast<typename std::underlying_type<TEnum>::type
>( rhs )
278 return ( std::type_index(
TypeID() )
279 < std::type_index(rhs.
TypeID() ) )
304 template<
typename TRecord>
311 <<
">(" <<
Integral() <<
") not found." )
314 "BOXING: Enum Record for type not found: ",
319 return *
reinterpret_cast<const TRecord*
>(
result );
340 template<
typename TRecord>
362 #if !defined (HPP_ALIB_STRINGS_ASTRING)
367 namespace alib {
namespace strings {
370 #if defined(ALIB_DOX)
371 namespace APPENDABLES {
393 #if defined(ALIB_DOX)
ALIB_API size_t Hashcode() const
decltype(std::declval< typename TFDecl::Signature >()(std::declval< Box & >(), std::declval< TArgs >()...)) Call(TArgs &&... args) const
const std::type_info & TypeID() const
#define ALIB_ASSERT_ERROR(cond,...)
#define ATMP_T_IF(T, Cond)
ALIB_API const void * getEnumRecord(const std::type_info &rtti, integer integral)
NLocalString< 128 > NString128
Type alias name for TLocalString<nchar,128> .
lang::integer integer
Type alias in namespace alib.
constexpr Enum(TEnum element)
bool operator<(Enum const &rhs) const
const TRecord & GetRecord()
const TRecord * TryRecord()
const Box & CastToBox() const
bool operator==(const Enum &rhs) const
bool operator==(TEnum rhs) const
bool operator!=(TEnum rhs) const
bool operator!=(const Enum &rhs) const
const std::type_info & TypeID() const
void operator()(TAString< TChar > &target, const boxing::Enum &value)
detail::UnionIntegrals Integrals
Collection of integrals of different sizes.
integer Int
Signed integral of platform-dependent size.