[ox/event] Move isError into namepsace detail

This commit is contained in:
Gary Talent 2021-08-03 00:21:05 -05:00
parent 8f6897225a
commit 38596ac941

View File

@ -19,6 +19,8 @@ class SignalHandler;
#ifndef OX_OS_BareMetal
namespace detail {
template<typename T>
struct isError {
static constexpr bool value = false;
@ -29,6 +31,8 @@ struct isError<Error> {
static constexpr bool value = true;
};
}
template<class... Args>
class Signal {
private:
@ -52,7 +56,7 @@ class Signal {
}
void call(Args... args) final {
if constexpr(isError<decltype(f(args...))>::value) {
if constexpr(detail::isError<decltype(f(args...))>::value) {
oxThrowError(f(args...));
} else {
f(args...);
@ -71,7 +75,7 @@ class Signal {
}
void call(Args... args) final {
if constexpr(isError<decltype((m_receiver->*(m_methodPtr))(args...))>::value) {
if constexpr(detail::isError<decltype((m_receiver->*(m_methodPtr))(args...))>::value) {
oxThrowError((m_receiver->*(m_methodPtr))(args...));
} else {
f(args...);
@ -98,7 +102,7 @@ class Signal {
}
void call(Args... args) final {
if constexpr(isError<decltype((m_receiver->*(m_methodPtr))(args...))>::value) {
if constexpr(detail::isError<decltype((m_receiver->*(m_methodPtr))(args...))>::value) {
oxThrowError((m_receiver->*(m_methodPtr))(args...));
} else {
(m_receiver->*(m_methodPtr))(args...);