8#ifndef HPP_ALIB_BOXING_ENUM
9#define HPP_ALIB_BOXING_ENUM 1
19namespace alib {
namespace boxing {
75 template<
typename TEnum,
typename TEnableIf>
77 constexpr Enum( TEnum element );
79 template<
typename TEnum,
80 typename TEnableIf =
typename std::enable_if<std::is_enum<TEnum>::value>::type >
81 constexpr Enum( TEnum element )
96 template<
typename TEnum>
100 template<
typename TEnum>
101 ATMP_T_IF(TEnum, std::is_enum<TEnum>::value )
173 return static_cast<Box&
>(*this);
184 return static_cast<const Box&
>(*this);
198 template<
typename TEnum>
202 template<
typename TEnum>
203 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
218 template<
typename TEnum>
222 template<
typename TEnum>
223 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
226 return Integral() ==
static_cast<typename std::underlying_type<TEnum>::type
>( rhs )
227 &&
TypeID() ==
typeid( TEnum );
239 template<
typename TEnum>
243 template<
typename TEnum>
244 ATMP_T_IF(
bool, std::is_enum<TEnum>::value)
247 return Integral() !=
static_cast<typename std::underlying_type<TEnum>::type
>( rhs )
248 ||
TypeID() !=
typeid( TEnum );
274 return ( std::type_index(
TypeID() )
275 < std::type_index(rhs.
TypeID() ) )
300 template<
typename TRecord>
307 <<
">(" <<
Integral() <<
") not found." )
310 "BOXING: Enum Record for type not found: ",
315 return *
reinterpret_cast<const TRecord*
>( result );
336 template<
typename TRecord>
358 #if !defined (HPP_ALIB_STRINGS_ASTRING)
363 namespace alib {
namespace strings {
367 namespace APPENDABLES {
374 template<
typename TChar,
typename TAllocator>
struct T_Append<boxing::
Enum, TChar,TAllocator>
ALIB_API size_t Hashcode() const
Placeholder data
The data that we encapsulate.
decltype(std::declval< typename TFDecl::Signature >()(std::declval< Box & >(), std::declval< TArgs >()...)) Call(TArgs &&... args) const
const std::type_info & TypeID() const
const TUnboxable Unbox() 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)
Enum()
Default constructor.
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, TAllocator > &target, const boxing::Enum &value)
detail::UnionIntegrals Integrals
Collection of integrals of different sizes.
integer Int
Signed integral of platform-dependent size.