10000 Use function declaration syntax in template type specification · dok-net/arduino-esp8266@c56fa87 · GitHub
[go: up one dir, main page]

Skip to content

Commit c56fa87

Browse files
committed
Use function declaration syntax in template type specification
1 parent d133e30 commit c56fa87

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

cores/esp8266/Delegate.h

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -785,18 +785,28 @@ namespace detail
785785
};
786786
};
787787

788+
template<typename R = void, typename A = void, typename... P>
789+
class Delegate : public detail::DelegatePImpl<A, R, P...>
790+
{
791+
using detail::DelegatePImpl<A, R, P...>::DelegatePImpl;
792+
};
793+
794+
template<typename R, typename A>
795+
class Delegate<R, A> : public detail::DelegateImpl<A, R>
796+
{
797+
using detail::DelegateImpl<A, R>::DelegateImpl;
798+
};
799+
788800
}
789801

790-
template<typename R = void, typename A = void, typename... P>
791-
class Delegate : public detail::DelegatePImpl<A, R, P...>
802+
template<typename R, typename A = void, typename... P> class Delegate;
803+
template<typename R, typename A, typename... P> class Delegate<R(A, P...), A> : public detail::Delegate<R, A, P...>
792804
{
793-
using detail::DelegatePImpl<A, R, P...>::DelegatePImpl;
805+
using detail::Delegate<R, A, P...>::Delegate;
794806
};
795-
796-
template<typename R, typename A>
797-
class Delegate<R, A> : public detail::DelegateImpl<A, R>
807+
template<typename R, typename... P> class Delegate<R(P...)> : public detail::Delegate<R, void, P...>
798808
{
799-
using detail::DelegateImpl<A, R>::DelegateImpl;
809+
using detail::Delegate<R, void, P...>::Delegate;
800810
};
801811

802812
#endif // __Delegate_h

0 commit comments

Comments
 (0)
0