25 template <
typename X,
typename = decltype(X())>
static yes test(X*);
27 template <
typename X>
static no test(...);
29 static constexpr nbool is =
sizeof(
decltype(test<T>(
nullptr))) ==
sizeof(yes);
37 template <
template <
typename>
class Template,
typename X>
static yes _foo(Template<X>*);
40 static inline constexpr nbool is =
sizeof(_foo((T*) 0)) ==
sizeof(yes);
47 template <
typename T,
typename super>
49 static inline constexpr nbool is = std::is_base_of<super, T>::value;
52 template <
typename T,
typename super>
struct tifSub<T&, super> {
53 static inline constexpr nbool is = std::is_base_of<super, T>::value;
56 template <
typename T,
typename super>
struct tifSub<T, super&> {
57 static inline constexpr nbool is = std::is_base_of<super, T>::value;
60 template <
typename T,
typename super>
struct tifSub<T&, super&> {
61 static inline constexpr nbool is = std::is_base_of<super, T>::value;
77 static inline constexpr nbool is =
false;
81 static inline constexpr nbool is =
true;
93 typedef typename T::super super;
100 template <typename T, nbool canMake = std::is_constructible<T>::value>
struct tinstanceMaker {
101 static void* make() {
return nullptr; }
105 static void* make() {
return (
void*)
new T(); }
123 static const nchar* getRawName() {
return typeid(T).name(); }
125 static std::string getName() {
126 std::string ret = platformAPI::filterDemangle(getRawName());
134 template <
typename T>
using void_t = void;
141 static inline constexpr nbool is =
false;
145 static inline constexpr nbool is =
true;
152 template <typename T, nbool hasMeta = tifHasMetaTypeDef<T>::is>
struct tmetaTypeDef {
157 using is =
typename T::metaType;
160 template <
typename T,
typename... Es>
using areBaseOfT = std::conjunction<std::is_base_of<T, Es>...>;
Base class for all types without explicit super class.
Definition: adam.hpp:11
Base class for runtime type information in byeol language.
Definition: type.hpp:12
Helper struct for SFINAE detection patterns.
Definition: rtti.hpp:68
Adaptive super type selector.
Definition: rtti.hpp:88
Type trait to check if type has default constructor.
Definition: rtti.hpp:24
Type trait to check if type has super typedef.
Definition: rtti.hpp:76
Type trait to check if T is subclass of super.
Definition: rtti.hpp:48
Type trait to check if type is a template specialization.
Definition: rtti.hpp:36
Instance factory for type creation.
Definition: rtti.hpp:100
Template name getter for type introspection.
Definition: rtti.hpp:122