8000 Solves problems with lambdas and std::bind · dok-net/arduino-esp8266@4b6020c · GitHub
[go: up one dir, main page]

Skip to content

Commit 4b6020c

Browse files
committed
Solves problems with lambdas and std::bind
1 parent 0f00454 commit 4b6020c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

cores/esp8266/Delegate.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ namespace detail
102102
DelegateImpl::obj = std::move(obj);
103103
}
104104

105-
DelegateImpl(const FunctionType& functional)
105+
template<typename F> DelegateImpl(const F& functional)
106106
{
107107
type = FUNC;
108108
new (&this->functional) FunctionType();
109109
DelegateImpl::functional = functional;
110110
}
111111

112-
DelegateImpl(FunctionType&& functional)
112+
template<typename F> DelegateImpl(F&& functional)
113113
{
114114
type = FUNC;
115115
new (&this->functional) FunctionType();
@@ -164,7 +164,7 @@ namespace detail
164164
return *this;
165165
}
166166

167-
DelegateImpl& operator=(const FunctionType& functional)
167+
template<typename F> DelegateImpl& operator=(const F& functional)
168168
{
169169
if (FUNC != type)
170170
{
@@ -175,7 +175,7 @@ namespace detail
175175
return *this;
176176
}
177177

178-
DelegateImpl& operator=(FunctionType&& functional)
178+
template<typename F> DelegateImpl& operator=(F&& functional)
179179
{
180180
if (FUNC != type)
181181
{
@@ -284,14 +284,14 @@ namespace detail
284284
DelegateImpl::fn = fn;
285285
}
286286

287-
DelegateImpl(const FunctionType& functional)
287+
template<typename F> DelegateImpl(const F& functional)
288288
{
289289
type = FUNC;
290290
new (&this->functional) FunctionType();
291291
DelegateImpl::functional = functional;
292292
}
293293

294-
DelegateImpl(FunctionType&& functional)
294+
template<typename F> DelegateImpl(F&& functional)
295295
{
296296
type = FUNC;
297297
new (&this->functional) FunctionType();
@@ -344,7 +344,7 @@ namespace detail
344344
return *this;
345345
}
346346

347-
DelegateImpl& operator=(const FunctionType& functional)
347+
template<typename F> DelegateImpl& operator=(const F& functional)
348348
{
349349
if (FUNC != type)
350350
{
@@ -355,7 +355,7 @@ namespace detail
355355
return *this;
356356
}
357357

358-
DelegateImpl& operator=(FunctionType&& functional)
358+
template<typename F> DelegateImpl& operator=(F&& functional)
359359
{
360360
if (FUNC != type)
361361
{

0 commit comments

Comments
 (0)
0