@@ -239,21 +239,6 @@ namespace delegate
239
239
return *this ;
240
240
}
241
241
242
- template <typename F> DelegatePImpl& operator =(F functional)
243
- {
244
- if (FUNC == kind)
245
- {
246
- this ->functional .~FunctionType ();
247
- }
248
- else if (FPA == kind)
249
- {
250
- obj.~A ();
251
- }
252
- kind = FUNC;
253
- new (&this ->functional ) FunctionType (std::forward<F>(functional));
254
- return *this ;
255
- }
256
-
257
242
DelegatePImpl& IRAM_ATTR operator =(std::nullptr_t )
258
243
{
259
244
if (FUNC == kind)
@@ -436,10 +421,10 @@ namespace delegate
436
421
DelegatePImpl::fn = fn;
437
422
}
438
423
439
- template <typename F> DelegatePImpl (F functional )
424
+ template <typename F> DelegatePImpl (F fn )
440
425
{
441
426
kind = FP;
442
- fn = std::forward<F>(functional );
427
+ DelegatePImpl:: fn = std::forward<F>(fn );
443
428
}
444
429
445
430
DelegatePImpl& operator =(const DelegatePImpl& del)
@@ -499,16 +484,6 @@ namespace delegate
499
484
return *this ;
500
485
}
501
486
502
- template <typename F> DelegatePImpl& operator =(F functional)
503
- {
504
- if (FPA == kind)
505
- {
506
- obj = {};
507
- }
508
- kind = FP;
509
- fn = std::forward<F>(functional);
510
- }
511
-
512
487
DelegatePImpl& IRAM_ATTR operator =(std::nullptr_t )
513
488
{
514
489
if (FPA == kind)
@@ -708,17 +683,6 @@ namespace delegate
708
683
return *this ;
709
684
}
710
685
711
- template <typename F> DelegatePImpl& operator =(F functional)
712
- {
713
- if (FUNC == kind)
714
- {
715
- this ->functional .~FunctionType ();
716
- }
717
- kind = FUNC;
718
- new (&this ->functional ) FunctionType (std::forward<F>(functional));
719
- return *this ;
720
- }
721
-
722
686
DelegatePImpl& IRAM_ATTR operator =(std::nullptr_t )
723
687
{
724
688
if (FUNC == kind)
@@ -859,12 +823,6 @@ namespace delegate
859
823
return *this ;
860
824
}
861
825
862
- template <typename F> DelegatePImpl& operator =(F functional)
863
- {
864
- fn = std::forward<F>(functional);
865
- return *this ;
866
- }
867
-
868
826
DelegatePImpl& IRAM_ATTR operator =(std::nullptr_t )
869
827
{
870
828
fn = nullptr ;
@@ -1082,21 +1040,6 @@ namespace delegate
1082
1040
return *this ;
1083
1041
}
1084
1042
1085
- template <typename F> DelegateImpl& operator =(F functional)
1086
- {
1087
- if (FUNC == kind)
1088
- {
1089
- this ->functional .~FunctionType ();
1090
- }
1091
- else if (FPA == kind)
1092
- {
1093
- obj.~A ();
1094
- }
1095
- kind = FUNC;
1096
- new (&this ->functional ) FunctionType (std::forward<F>(functional));
1097
- return *this ;
1098
- }
1099
-
1100
1043
DelegateImpl& IRAM_ATTR operator =(std::nullptr_t )
1101
1044
{
1102
1045
if (FUNC == kind)
@@ -1341,17 +1284,6 @@ namespace delegate
1341
1284
return *this ;
1342
1285
}
1343
1286
1344
- template <typename F> DelegateImpl& operator =(F functional)
1345
- {
1346
- if (FPA == kind)
1347
- {
1348
- obj.~A ();
1349
- }
1350
- kind = FP;
1351
- fn = std::forward<F>(functional);
1352
- return *this ;
1353
- }
1354
-
1355
1287
DelegateImpl& IRAM_ATTR operator =(std::nullptr_t )
1356
1288
{
1357
1289
if (FPA == kind)
@@ -1550,17 +1482,6 @@ namespace delegate
1550
1482
return *this ;
1551
1483
}
1552
1484
1553
- template <typename F> DelegateImpl& operator =(F functional)
1554
- {
1555
- if (FUNC == kind)
1556
- {
1557
- this ->functional .~FunctionType ();
1558
- }
1559
- kind = FUNC;
1560
- new (&this ->functional ) FunctionType (std::forward<F>(functional));
1561
- return *this ;
1562
- }
1563
-
1564
1485
DelegateImpl& IRAM_ATTR operator =(std::nullptr_t )
1565
1486
{
1566
1487
if (FUNC == kind)
@@ -1701,12 +1622,6 @@ namespace delegate
1701
1622
return *this ;
1702
1623
}
1703
1624
1704
- template <typename F> DelegateImpl& operator =(F functional)
1705
- {
1706
- fn = std::forward<F>(functional);
1707
- return *this ;
1708
- }
1709
-
1710
1625
DelegateImpl& IRAM_ATTR operator =(std::nullptr_t )
1711
1626
{
1712
1627
fn = nullptr ;
@@ -1768,15 +1683,15 @@ namespace delegate
1768
1683
static_cast <const detail::DelegatePImpl<A, R, P...>&>(del)) {}
1769
1684
1770
1685
Delegate (Delegate&& del) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(
1771
- std::move (static_cast <detail::DelegatePImpl<A, R, P...>&>(del))) {}
1686
+ std::move (static_cast <detail::DelegatePImpl<A, R, P...>&& >(del))) {}
1772
1687
1773
1688
Delegate (FunAPtr fnA, const A& obj) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fnA, obj) {}
1774
1689
1775
1690
Delegate (FunAPtr fnA, A&& obj) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fnA, std::move(obj)) {}
1776
1691
1777
1692
Delegate (FunPtr fn) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(fn) {}
1778
1693
1779
- template <typename F> Delegate (F functional) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(std::forward<F>( functional) ) {}
1694
+ template <typename F> Delegate (F functional) : detail::DelegatePImpl<A, R, P...>::DelegatePImpl(functional) {}
1780
1695
1781
1696
Delegate& operator =(const Delegate& del) {
1782
1697
detail::DelegatePImpl<A, R, P...>::operator =(del);
@@ -1793,11 +1708,6 @@ namespace delegate
1793
1708
return *this ;
1794
1709
}
1795
1710
1796
- template <typename F> Delegate& operator =(F functional) {
1797
- detail::DelegatePImpl<A, R, P...>::operator =(std::forward<F>(functional));
1798
- return *this ;
1799
- }
1800
-
1801
1711
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
1802
1712
detail::DelegatePImpl<A, R, P...>::operator =(nullptr );
1803
1713
return *this ;
@@ -1854,13 +1764,13 @@ namespace delegate
1854
1764
static_cast <const detail::DelegatePImpl<A*, R, P...>&>(del)) {}
1855
1765
1856
1766
Delegate (Delegate&& del) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(
1857
- std::move (static_cast <detail::DelegatePImpl<A*, R, P...>&>(del))) {}
1767
+ std::move (static_cast <detail::DelegatePImpl<A*, R, P...>&& >(del))) {}
1858
1768
1859
1769
Delegate (FunAPtr fnA, A* obj) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(fnA, obj) {}
1860
1770
1861
1771
Delegate (FunPtr fn) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(fn) {}
1862
1772
1863
- template <typename F> Delegate (F functional) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(std::forward<F>( functional) ) {}
1773
+ template <typename F> Delegate (F functional) : detail::DelegatePImpl<A*, R, P...>::DelegatePImpl(functional) {}
1864
1774
1865
1775
Delegate& operator =(const Delegate& del) {
1866
1776
detail::DelegatePImpl<A*, R, P...>::operator =(del);
@@ -1877,11 +1787,6 @@ namespace delegate
1877
1787
return *this ;
1878
1788
}
1879
1789
1880
- template <typename F> Delegate& operator =(F functional) {
1881
- detail::DelegatePImpl<A*, R, P...>::operator =(std::forward<F>(functional));
1882
- return *this ;
1883
- }
1884
-
1885
1790
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
1886
1791
detail::DelegatePImpl<A*, R, P...>::operator =(nullptr );
1887
1792
return *this ;
@@ -1917,11 +1822,11 @@ namespace delegate
1917
1822
static_cast <const detail::DelegatePImpl<void , R, P...>&>(del)) {}
1918
1823
1919
1824
Delegate (Delegate&& del) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(
1920
- std::move (static_cast <detail::DelegatePImpl<void , R, P...>&>(del))) {}
1825
+ std::move (static_cast <detail::DelegatePImpl<void , R, P...>&& >(del))) {}
1921
1826
1922
1827
Delegate (FunPtr fn) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(fn) {}
1923
1828
1924
- template <typename F> Delegate (F functional) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(std::forward<F>( functional) ) {}
1829
+ template <typename F> Delegate (F functional) : detail::DelegatePImpl<void, R, P...>::DelegatePImpl(functional) {}
1925
1830
1926
1831
Delegate& operator =(const Delegate& del) {
1927
1832
detail::DelegatePImpl<void , R, P...>::operator =(del);
@@ -1938,11 +1843,6 @@ namespace delegate
1938
1843
return *this ;
1939
1844
}
1940
1845
1941
- template <typename F> Delegate& operator =(F functional) {
1942
- detail::DelegatePImpl<void , R, P...>::operator =(std::forward<F>(functional));
1943
- return *this ;
1944
- }
1945
-
1946
1846
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
1947
1847
detail::DelegatePImpl<void , R, P...>::operator =(nullptr );
1948
1848
return *this ;
@@ -1979,15 +1879,15 @@ namespace delegate
1979
1879
static_cast <const detail::DelegateImpl<A, R>&>(del)) {}
1980
1880
1981
1881
Delegate (Delegate&& del) : detail::DelegateImpl<A, R>::DelegateImpl(
1982
- std::move (static_cast <detail::DelegateImpl<A, R>&>(del))) {}
1882
+ std::move (static_cast <detail::DelegateImpl<A, R>&& >(del))) {}
1983
1883
1984
1884
Delegate (FunAPtr fnA, const A& obj) : detail::DelegateImpl<A, R>::DelegateImpl(fnA, obj) {}
1985
1885
1986
1886
Delegate (FunAPtr fnA, A&& obj) : detail::DelegateImpl<A, R>::DelegateImpl(fnA, std::move(obj)) {}
1987
1887
1988
1888
Delegate (FunPtr fn) : detail::DelegateImpl<A, R>::DelegateImpl(fn) {}
1989
1889
1990
- template <typename F> Delegate (F functional) : detail::DelegateImpl<A, R>::DelegateImpl(std::forward<F>( functional) ) {}
1890
+ template <typename F> Delegate (F functional) : detail::DelegateImpl<A, R>::DelegateImpl(functional) {}
1991
1891
1992
1892
Delegate& operator =(const Delegate& del) {
1993
1893
detail::DelegateImpl<A, R>::operator =(del);
@@ -2004,11 +1904,6 @@ namespace delegate
2004
1904
return *this ;
2005
1905
}
2006
1906
2007
- template <typename F> Delegate& operator =(F functional) {
2008
- detail::DelegateImpl<A, R>::operator =(std::forward<F>(functional));
2009
- return *this ;
2010
- }
2011
-
2012
1907
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
2013
1908
detail::DelegateImpl<A, R>::operator =(nullptr );
2014
1909
return *this ;
@@ -2065,13 +1960,13 @@ namespace delegate
2065
1960
static_cast <const detail::DelegateImpl<A*, R>&>(del)) {}
2066
1961
2067
1962
Delegate (Delegate&& del) : detail::DelegateImpl<A*, R>::DelegateImpl(
2068
- std::move (static_cast <detail::DelegateImpl<A*, R>&>(del))) {}
1963
+ std::move (static_cast <detail::DelegateImpl<A*, R>&& >(del))) {}
2069
1964
2070
1965
Delegate (FunAPtr fnA, A* obj) : detail::DelegateImpl<A*, R>::DelegateImpl(fnA, obj) {}
2071
1966
2072
1967
Delegate (FunPtr fn) : detail::DelegateImpl<A*, R>::DelegateImpl(fn) {}
2073
1968
2074
- template <typename F> Delegate (F functional) : detail::DelegateImpl<A*, R>::DelegateImpl(std::forward<F>( functional) ) {}
1969
+ template <typename F> Delegate (F functional) : detail::DelegateImpl<A*, R>::DelegateImpl(functional) {}
2075
1970
2076
1971
Delegate& operator =(const Delegate& del) {
2077
1972
detail::DelegateImpl<A*, R>::operator =(del);
@@ -2088,11 +1983,6 @@ namespace delegate
2088
1983
return *this ;
2089
1984
}
2090
1985
2091
- template <typename F> Delegate& operator =(F functional) {
2092
- detail::DelegateImpl<A*, R>::operator =(std::forward<F>(functional));
2093
- return *this ;
2094
- }
2095
-
2096
1986
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
2097
1987
detail::DelegateImpl<A*, R>::operator =(nullptr );
2098
1988
return *this ;
@@ -2128,11 +2018,11 @@ namespace delegate
2128
2018
static_cast <const detail::DelegateImpl<void , R>&>(del)) {}
2129
2019
2130
2020
Delegate (Delegate&& del) : detail::DelegateImpl<void, R>::DelegateImpl(
2131
- std::move (static_cast <detail::DelegateImpl<void , R>&>(del))) {}
2021
+ std::move (static_cast <detail::DelegateImpl<void , R>&& >(del))) {}
2132
2022
2133
2023
Delegate (FunPtr fn) : detail::DelegateImpl<void, R>::DelegateImpl(fn) {}
2134
2024
2135
- template <typename F> Delegate (F functional) : detail::DelegateImpl<void, R>::DelegateImpl(std::forward<F>( functional) ) {}
2025
+ template <typename F> Delegate (F functional) : detail::DelegateImpl<void, R>::DelegateImpl(functional) {}
2136
2026
2137
2027
Delegate& operator =(const Delegate& del) {
2138
2028
detail::DelegateImpl<void , R>::operator =(del);
@@ -2149,11 +2039,6 @@ namespace delegate
2149
2039
return *this ;
2150
2040
}
2151
2041
2152
- template <typename F> Delegate& operator =(F functional) {
2153
- detail::DelegateImpl<void , R>::operator =(std::forward<F>(functional));
2154
- return *this ;
2155
- }
2156
-
2157
2042
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
2158
2043
detail::DelegateImpl<void , R>::operator =(nullptr );
2159
2044
return *this ;
@@ -2174,15 +2059,15 @@ template<typename A, typename R, typename... P> class Delegate<R(P...), A> : pub
2174
2059
static_cast <const delegate::detail::Delegate<A, R, P...>&>(del)) {}
2175
2060
2176
2061
Delegate (Delegate&& del) : delegate::detail::Delegate<A, R, P...>::Delegate(
2177
- std::move (static_cast <delegate::detail::Delegate<A, R, P...>&>(del))) {}
2062
+ std::move (static_cast <delegate::detail::Delegate<A, R, P...>&& >(del))) {}
2178
2063
2179
2064
Delegate (typename delegate::detail::Delegate<A, R, P...>::FunAPtr fnA, const A& obj) : delegate::detail::Delegate<A, R, P...>::Delegate(fnA, obj) {}
2180
2065
2181
2066
Delegate (typename delegate::detail::Delegate<A, R, P...>::FunAPtr fnA, A&& obj) : delegate::detail::Delegate<A, R, P...>::Delegate(fnA, std::move(obj)) {}
2182
2067
2183
2068
Delegate (typename delegate::detail::Delegate<A, R, P...>::FunPtr fn) : delegate::detail::Delegate<A, R, P...>::Delegate(fn) {}
2184
2069
2185
- template <typename F> Delegate (F functional) : delegate::detail::Delegate<A, R, P...>::Delegate(std::forward<F>( functional) ) {}
2070
+ template <typename F> Delegate (F functional) : delegate::detail::Delegate<A, R, P...>::Delegate(functional) {}
2186
2071
2187
2072
Delegate& operator =(const Delegate& del) {
2188
2073
delegate::detail::Delegate<A, R, P...>::operator =(del);
@@ -2199,17 +2084,11 @@ template<typename A, typename R, typename... P> class Delegate<R(P...), A> : pub
2199
2084
return *this ;
2200
2085
}
2201
2086
2202
- template <typename F> Delegate& operator =(F functional) {
2203
- delegate::detail::Delegate<A, R, P...>::operator =(std::forward<F>(functional));
2204
- return *this ;
2205
- }
2206
-
2207
2087
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
2208
2088
delegate::detail::Delegate<A, R, P...>::operator =(nullptr );
2209
2089
return *this ;
2210
2090
}
2211
2091
};
2212
-
2213
2092
template <typename R, typename ... P> class Delegate <R(P...)> : public delegate::detail::Delegate<void , R, P...>
2214
2093
{
2215
2094
public:
@@ -2221,11 +2100,11 @@ template<typename R, typename... P> class Delegate<R(P...)> : public delegate::d
2221
2100
static_cast <const delegate::detail::Delegate<void , R, P...>&>(del)) {}
2222
2101
2223
2102
Delegate (Delegate&& del) : delegate::detail::Delegate<void , R, P...>::Delegate(
2224
- std::move (static_cast <delegate::detail::Delegate<void , R, P...>&>(del))) {}
2103
+ std::move (static_cast <delegate::detail::Delegate<void , R, P...>&& >(del))) {}
2225
2104
2226
2105
Delegate (typename delegate::detail::Delegate<void , R, P...>::FunPtr fn) : delegate::detail::Delegate<void, R, P...>::Delegate(fn) {}
2227
2106
2228
- template <typename F> Delegate (F functional) : delegate::detail::Delegate<void, R, P...>::Delegate(std::forward<F>( functional) ) {}
2107
+ template <typename F> Delegate (F functional) : delegate::detail::Delegate<void, R, P...>::Delegate(functional) {}
2229
2108
2230
2109
Delegate& operator =(const Delegate& del) {
2231
2110
delegate::detail::Delegate<void , R, P...>::operator =(del);
@@ -2242,11 +2121,6 @@ template<typename R, typename... P> class Delegate<R(P...)> : public delegate::d
2242
2121
return *this ;
2243
2122
}
2244
2123
2245
- template <typename F> Delegate& operator =(F functional) {
2246
- delegate::detail::Delegate<void , R, P...>::operator =(std::forward<F>(functional));
2247
- return *this ;
2248
- }
2249
-
2250
2124
Delegate& IRAM_ATTR operator =(std::nullptr_t ) {
2251
2125
delegate::detail::Delegate<void , R, P...>::operator =(nullptr );
2252
2126
return *this ;
0 commit comments