8000 Re-apply std::forwards and minor identifier rename. · dok-net/arduino-esp8266@099fc86 · GitHub
[go: up one dir, main page]

Skip to content

Commit 099fc86

Browse files
committed
Re-apply std::forwards and minor identifier rename.
(cherry picked from commit 7c9c23e)
1 parent 6b6dbee commit 099fc86

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

cores/esp8266/Delegate.h

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,10 @@ namespace delegate
421421
DelegatePImpl::fn = fn;
422422
}
423423

424-
template<typename F> DelegatePImpl(F fn)
424+
template<typename F> DelegatePImpl(F functional)
425425
{
426426
kind = FP;
427-
DelegatePImpl::fn = std::forward<F>(fn);
427+
fn = std::forward<F>(functional);
428428
}
429429

430430
DelegatePImpl& operator=(const DelegatePImpl& del)
@@ -1683,15 +1683,15 @@ namespace delegate
16831683
static_cast<const detail::DelegatePImpl<A, R, P...>&>(del)) {}
16841684

16851685
Delegate(Delegate&& del) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(
1686-
std::move(static_cast<detail::DelegatePImpl<A, R, P...>&&>(del))) {}
1686+
std::move(static_cast<detail::DelegatePImpl<A, R, P...>&>(del))) {}
16871687

16881688
Delegate(FunAPtr fnA, const A& obj) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fnA, obj) {}
16891689

16901690
Delegate(FunAPtr fnA, A&& obj) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fnA, std::move(obj)) {}
16911691

16921692
Delegate(FunPtr fn) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fn) {}
16931693

1694-
template<typename F> Delegate(F functional) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(functional) {}
1694+
template<typename F> Delegate(F functional) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(std::forward<F>(functional)) {}
16951695

16961696
Delegate& operator=(const Delegate& del) {
16971697
detail::DelegatePImpl<A, R, P...>::operator=(del);
@@ -1764,13 +1764,13 @@ namespace delegate
17641764
static_cast<const detail::DelegatePImpl<A*, R, P...>&>(del)) {}
17651765

17661766
Delegate(Delegate&& del) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(
1767-
std::move(static_cast<detail::DelegatePImpl<A*, R, P...>&&>(del))) {}
1767+
std::move(static_cast<detail::DelegatePImpl<A*, R, P...>&>(del))) {}
17681768

17691769
Delegate(FunAPtr fnA, A* obj) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(fnA, obj) {}
17701770

17711771
Delegate(FunPtr fn) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(fn) {}
17721772

1773-
template<typename F> Delegate(F functional) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(functional) {}
1773+
template<typename F> Delegate(F functional) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(std::forward<F>(functional)) {}
17741774

17751775
Delegate& operator=(const Delegate& del) {
17761776
detail::DelegatePImpl<A*, R, P...>::operator=(del);
@@ -1822,11 +1822,11 @@ namespace delegate
18221822
static_cast<const detail::DelegatePImpl<void, R, P...>&>(del)) {}
18231823

18241824
Delegate(Delegate&& del) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(
1825-
std::move(static_cast<detail::DelegatePImpl<void, R, P...>&&>(del))) {}
1825+
std::move(static_cast<detail::DelegatePImpl<void, R, P...>&>(del))) {}
18261826

18271827
Delegate(FunPtr fn) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(fn) {}
18281828

1829-
template<typename F> Delegate(F functional) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(functional) {}
1829+
template<typename F> Delegate(F functional) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(std::forward<F>(functional)) {}
18301830

18311831
Delegate& operator=(const Delegate& del) {
18321832
detail::DelegatePImpl<void, R, P...>::operator=(del);
@@ -1879,15 +1879,15 @@ namespace delegate
18791879
static_cast<const detail::DelegateImpl<A, R>&>(del)) {}
18801880

18811881
Delegate(Delegate&& del) : detail::DelegateImpl<A, R>::DelegateImpl(
1882-
std::move(static_cast<detail::DelegateImpl<A, R>&&>(del))) {}
1882+
std::move(static_cast<detail::DelegateImpl<A, R>&>(del))) {}
18831883

18841884
Delegate(FunAPtr fnA, const A& obj) : detail::DelegateImpl<A, R>::DelegateImpl(fnA, obj) {}
18851885

18861886
Delegate(FunAPtr fnA, A&& obj) : detail::DelegateImpl<A, R>::DelegateImpl(fnA, std::move(obj)) {}
18871887

18881888
Delegate(FunPtr fn) : detail::DelegateImpl<A, R>::DelegateImpl(fn) {}
18891889

1890-
template<typename F> Delegate(F functional) : detail::DelegateImpl<A, R>::DelegateImpl(functional) {}
1890+
template<typename F> Delegate(F functional) : detail::DelegateImpl<A, R>::DelegateImpl(std::forward<F>(functional)) {}
18911891

18921892
Delegate& operator=(const Delegate& del) {
18931893
detail::DelegateImpl<A, R>::operator=(del);
@@ -1960,13 +1960,13 @@ namespace delegate
19601960
static_cast<const detail::DelegateImpl<A*, R>&>(del)) {}
19611961

19621962
Delegate(Delegate&& del) : detail::DelegateImpl<A*, R>::DelegateImpl(
1963-
std::move(static_cast<detail::DelegateImpl<A*, R>&&>(del))) {}
1963+
std::move(static_cast<detail::DelegateImpl<A*, R>&>(del))) {}
19641964

19651965
Delegate(FunAPtr fnA, A* obj) : detail::DelegateImpl<A*, R>::DelegateImpl(fnA, obj) {}
19661966

19671967
Delegate(FunPtr fn) : detail::DelegateImpl<A*, R>::DelegateImpl(fn) {}
19681968

1969-
template<typename F> Delegate(F functional) : detail::DelegateImpl<A*, R>::DelegateImpl(functional) {}
1969+
template<typename F> Delegate(F functional) : detail::DelegateImpl<A*, R>::DelegateImpl(std::forward<F>(functional)) {}
19701970

19711971
Delegate& operator=(const Delegate& del) {
19721972
detail::DelegateImpl<A*, R>::operator=(del);
@@ -2018,11 +2018,11 @@ namespace delegate
20182018
static_cast<const detail::DelegateImpl<void, R>&>(del)) {}
20192019

20202020
Delegate(Delegate&& del) : detail::DelegateImpl<void, R>::DelegateImpl(
2021-
std::move(static_cast<detail::DelegateImpl<void, R>&&>(del))) {}
2021+
std::move(static_cast<detail::DelegateImpl<void, R>&>(del))) {}
20222022

20232023
Delegate(FunPtr fn) : detail::DelegateImpl<void, R>::DelegateImpl(fn) {}
20242024

2025-
template<typename F> Delegate(F functional) : detail::DelegateImpl<void, R>::DelegateImpl(functional) {}
2025+
template<typename F> Delegate(F functional) : detail::DelegateImpl<void, R>::DelegateImpl(std::forward<F>(functional)) {}
20262026

20272027
Delegate& operator=(const Delegate& del) {
20282028
detail::DelegateImpl<void, R>::operator=(del);
@@ -2059,15 +2059,15 @@ template<typename A, typename R, typename... P> class Delegate<R(P...), A> : pub
20592059
static_cast<const delegate::detail::Delegate<A, R, P...>&>(del)) {}
20602060

20612061
Delegate(Delegate&& del) : delegate::detail::Delegate<A, R, P...>::Delegate(
2062-
std::move(static_cast<delegate::detail::Delegate<A, R, P...>&&>(del))) {}
2062+
std::move(static_cast<delegate::detail::Delegate<A, R, P...>&>(del))) {}
20632063

20642064
Delegate(typename delegate::detail::Delegate<A, R, P...>::FunAPtr fnA, const A& obj) : delegate::detail::Delegate<A, R, P...>::Delegate(fnA, obj) {}
20652065

20662066
Delegate(typename delegate::detail::Delegate<A, R, P...>::FunAPtr fnA, A&& obj) : delegate::detail::Delegate<A, R, P...>::Delegate(fnA, std::move(obj)) {}
20672067

20682068
Delegate(typename delegate::detail::Delegate<A, R, P...>::FunPtr fn) : delegate::detail::Delegate<A, R, P...>::Delegate(fn) {}
20692069

2070-
template<typename F> Delegate(F functional) : delegate::detail::Delegate<A, R, P...>::Delegate(functional) {}
2070+
template<typename F> Delegate(F functional) : delegate::detail::Delegate<A, R, P...>::Delegate(std::forward<F>(functional)) {}
20712071

20722072
Delegate& operator=(const Delegate& del) {
20732073
delegate::detail::Delegate<A, R, P...>::operator=(del);
@@ -2089,6 +2089,7 @@ template<typename A, typename R, typename... P> class Delegate<R(P...), A> : pub
20892089
return *this;
20902090
}
20912091
};
2092+
20922093
template<typename R, typename... P> class Delegate<R(P...)> : public delegate::detail::Delegate<void, R, P...>
20932094
{
20942095
public:
@@ -2100,11 +2101,11 @@ template<typename R, typename... P> class Delegate<R(P...)> : public delegate::d
21002101
static_cast<const delegate::detail::Delegate<void, R, P...>&>(del)) {}
21012102

21022103
Delegate(Delegate&& del) : delegate::detail::Delegate<void, R, P...>::Delegate(
2103-
std::move(static_cast<delegate::detail::Delegate<void, R, P...>&&>(del))) {}
2104+
std::move(static_cast<delegate::detail::Delegate<void, R, P...>&>(del))) {}
21042105

21052106
Delegate(typename delegate::detail::Delegate<void, R, P...>::FunPtr fn) : delegate::detail::Delegate<void, R, P...>::Delegate(fn) {}
21062107

2107-
template<typename F> Delegate(F functional) : delegate::detail::Delegate<void, R, P...>::Delegate(functional) {}
2108+
template<typename F> Delegate(F functional) : delegate::detail::Delegate<void, R, P...>::Delegate(std::forward<F>(functional)) {}
21082109

21092110
Delegate& operator=(const Delegate& del) {
21102111
delegate::detail::Delegate<void, R, P...>::operator=(del);

0 commit comments

Comments
 (0)
0