Skip to content

Commit 57a87ca

Browse files
committed
Constness fix for iterator dereference
1 parent 1f193ab commit 57a87ca

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cores/esp8266/MultiDelegate.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,11 @@ namespace delegate
244244
bool operator!=(const iterator& rhs) const {
245245
return !operator==(rhs);
246246
}
247-
const Delegate& operator*() const
247+
Delegate& operator*() const
248248
{
249249
return current->mDelegate;
250250
}
251-
const Delegate* const operator->() const
251+
Delegate* const operator->() const
252252
{
253253
return &current->mDelegate;
254254
}
@@ -349,7 +349,7 @@ namespace delegate
349349
auto it = begin();
350350
while (it)
351351
{
352-
if (del == &it.current->mDelegate)
352+
if (del == &(*it))
353353
{
354354
erase(it);
355355
return true;
@@ -382,7 +382,7 @@ namespace delegate
382382
R result;
383383
do
384384
{
385-
result = CallP<Delegate, R, ISQUEUE, P...>::execute(it.current->mDelegate, args...);
385+
result = CallP<Delegate, R, ISQUEUE, P...>::execute(*it, args...);
386386
if (result && ISQUEUE)
387387
it = erase(it);
388388
else
@@ -422,7 +422,7 @@ namespace delegate
422422
R result;
423423
do
424424
{
425-
result = Call<Delegate, R, ISQUEUE>::execute(it.current->mDelegate);
425+
result = Call<Delegate, R, ISQUEUE>::execute(*it);
426426
if (result && ISQUEUE)
427427
it = this->erase(it);
428428
else
@@ -477,7 +477,7 @@ namespace delegate
477477

478478
do
479479
{
480-
CallP<Delegate, void, ISQUEUE, P...>::execute(it.current->mDelegate, args...);
480+
CallP<Delegate, void, ISQUEUE, P...>::execute(*it, args...);
481481
if (ISQUEUE)
482482
it = this->erase(it);
483483
else
@@ -515,7 +515,7 @@ namespace delegate
515515

516516
do
517517
{
518-
Call<Delegate, void, ISQUEUE>::execute(it.current->mDelegate);
518+
Call<Delegate, void, ISQUEUE>::execute(*it);
519519
if (ISQUEUE)
520520
it = this->erase(it);
521521
else

0 commit comments

Comments
 (0)