summary refs log tree commit diff
path: root/src/EventAccessors.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/EventAccessors.h')
-rw-r--r--src/EventAccessors.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/EventAccessors.h b/src/EventAccessors.h

index ced159c1..a58c7de0 100644 --- a/src/EventAccessors.h +++ b/src/EventAccessors.h
@@ -11,6 +11,32 @@ #include <mtx/events/collections.hpp> +namespace nheko { +struct nonesuch +{ + ~nonesuch() = delete; + nonesuch(nonesuch const &) = delete; + void operator=(nonesuch const &) = delete; +}; + +namespace detail { +template<class Default, class AlwaysVoid, template<class...> class Op, class... Args> +struct detector +{ + using value_t = std::false_type; + using type = Default; +}; + +template<class Default, template<class...> class Op, class... Args> +struct detector<Default, std::void_t<Op<Args...>>, Op, Args...> +{ + using value_t = std::true_type; + using type = Op<Args...>; +}; + +} // namespace detail +} + namespace mtx::accessors { std::string event_id(const mtx::events::collections::TimelineEvents &event);