1#ifndef MECACELL_INTROSPECT_HPP
2#define MECACELL_INTROSPECT_HPP
16#define DEBUG_TYPE(x) \
19 debug_type<T>(T(), #x); \
23 template <
typename U>
debug_type(
void (*)(U),
const std::string &p_str) {
24 std::string str(p_str.begin() + 1, p_str.end() - 1);
28 name = abi::__cxa_demangle(
typeid(U).name(), 0, 0, &status);
38#define CREATE_METHOD_CHECKS(method) \
40 template <typename C, typename F> struct is_##method##_callable {}; \
41 template <typename C, typename Ret, typename... Args> \
42 struct is_##method##_callable<C, Ret(Args...)> { \
43 template <typename T> static constexpr bool is(...) { return false; } \
44 template <typename T> \
45 static constexpr bool is( \
46 typename std::is_same< \
47 Ret, decltype(std::declval<T>().method(std::declval<Args...>()))>::type *) { \
50 static constexpr bool value = is<C>(nullptr); \
53 template <typename C, typename F> struct has_##method##_signature {}; \
54 template <typename C, typename Ret, typename... Args> \
55 struct has_##method##_signature<C, Ret(Args...)> { \
56 using SIG = Ret (C::*)(Args...); \
57 template <typename T, T> struct same; \
58 template <typename T> \
59 static constexpr auto has(same<SIG, &T::method> *) -> typename std::true_type::type; \
60 template <typename T> \
61 static constexpr auto has(...) -> typename std::false_type::type; \
62 static constexpr bool value = decltype(has<C>(0))::value; \
this file contains various miscellanious utility functions & helpers *
typename make_void< Ts... >::type void_t
iostream cout
Standard output stream.
iostream endl
End-of-line manipulator.
debug_type(void(*)(U), const std::string &p_str)