@@ -44,10 +44,11 @@ namespace detail
44
44
class DelegatePImpl {
45
45
public:
46
46
using target_type = R(P...);
47
- using FunPtr = R(*)(P...);
47
+ private:
48
+ using FunPtr = target_type*;
48
49
using FunAPtr = R(*)(A, P...);
49
50
using FunctionType = std::function<target_type>;
50
-
51
+ public:
51
52
DelegatePImpl ()
52
53
{
53
54
fn = nullptr ;
@@ -304,7 +305,7 @@ namespace detail
304
305
}
305
306
}
306
307
307
- protected :
308
+ private :
308
309
enum { FUNC, FP, FPA } kind = FP;
309
310
union {
310
311
FunctionType functional;
@@ -320,9 +321,10 @@ namespace detail
320
321
class DelegatePImpl {
321
322
public:
322
323
using target_type = R(P...);
323
- using FunPtr = R(*)(P...);
324
+ private:
325
+ using FunPtr = target_type*;
324
326
using FunAPtr = R(*)(A, P...);
325
-
327
+ public:
326
328
DelegatePImpl ()
327
329
{
328
330
fn = nullptr ;
@@ -473,7 +475,7 @@ namespace detail
473
475
}
474
476
}
475
477
476
- protected :
478
+ private :
477
479
enum { FP, FPA } kind = FP;
478
480
union {
479
481
FunPtr fn;
@@ -488,9 +490,10 @@ namespace detail
488
490
class DelegatePImpl <void , R, P...> {
489
491
public:
490
492
using target_type = R(P...);
491
- using FunPtr = R(*)(P...);
493
+ private:
494
+ using FunPtr = target_type*;
492
495
using FunctionType = std::function<target_type>;
493
-
496
+ public:
494
497
DelegatePImpl ()
495
498
{
496
499
fn = nullptr ;
@@ -665,7 +668,7 @@ namespace detail
665
668
}
666
669
}
667
670
668
- protected :
671
+ private :
669
672
enum { FUNC, FP } kind = FP;
670
673
union {
671
674
FunctionType functional;
@@ -677,8 +680,9 @@ namespace detail
677
680
class DelegatePImpl <void , R, P...> {
678
681
public:
679
682
using target_type = R(P...);
680
- using FunPtr = R(*)(P...);
681
-
683
+ private:
684
+ using FunPtr = target_type*;
685
+ public:
682
686
DelegatePImpl ()
683
687
{
684
688
fn = nullptr ;
@@ -740,7 +744,7 @@ namespace detail
740
744
return fn (std::forward<P...>(args...));
741
745
}
742
746
743
- protected :
747
+ private :
744
748
FunPtr fn;
745
749
};
746
750
#endif
@@ -750,10 +754,11 @@ namespace detail
750
754
class DelegateImpl {
751
755
public:
752
756
using target_type = R();
753
- using FunPtr = R(*)();
757
+ private:
758
+ using FunPtr = target_type*;
754
759
using FunAPtr = R(*)(A);
755
760
using FunctionType = std::function<target_type>;
756
-
761
+ public:
757
762
DelegateImpl ()
758
763
{
759
764
fn = nullptr ;
@@ -1010,7 +1015,7 @@ namespace detail
1010
1015
}
1011
1016
}
1012
1017
1013
- protected :
1018
+ private :
1014
1019
enum { FUNC, FP, FPA } kind = FP;
1015
1020
union {
1016
1021
FunctionType functional;
@@ -1026,9 +1031,10 @@ namespace detail
1026
1031
class DelegateImpl {
1027
1032
public:
1028
1033
using target_type = R();
1029
- using FunPtr = R(*)();
1034
+ private:
1035
+ using FunPtr = target_type*;
1030
1036
using FunAPtr = R(*)(A);
1031
-
1037
+ public:
1032
1038
DelegateImpl ()
1033
1039
{
1034
1040
fn = nullptr ;
@@ -1179,7 +1185,7 @@ namespace detail
1179
1185
}
1180
1186
}
1181
1187
1182
- protected :
1188
+ private :
1183
1189
enum { FP, FPA } kind = FP;
1184
1190
union {
1185
1191
FunPtr fn;
@@ -1194,9 +1200,10 @@ namespace detail
1194
1200
class DelegateImpl <void , R> {
1195
1201
public:
1196
1202
using target_type = R();
1197
- using FunPtr = R(*)();
1203
+ private:
1204
+ using FunPtr = target_type*;
1198
1205
using FunctionType = std::function<target_type>;
1199
-
1206
+ public:
1200
1207
DelegateImpl ()
1201
1208
{
1202
1209
fn = nullptr ;
@@ -1371,7 +1378,7 @@ namespace detail
1371
1378
}
1372
1379
}
1373
1380
1374
- protected :
1381
+ private :
1375
1382
enum { FUNC, FP } kind = FP;
1376
1383
union {
1377
1384
FunctionType functional;
@@ -1383,8 +1390,9 @@ namespace detail
1383
1390
class DelegateImpl <void , R> {
1384
1391
public:
1385
1392
using target_type = R();
1386
- usi
F438
ng FunPtr = R(*)();
1387
-
1393
+ private:
1394
+ using FunPtr = target_type*;
1395
+ public:
1388
1396
DelegateImpl ()
1389
1397
{
1390
1398
fn = nullptr ;
@@ -1446,20 +1454,22 @@ namespace detail
1446
1454
return fn ();
1447
1455
}
1448
1456
1449
- protected :
1457
+ private :
1450
1458
FunPtr fn;
1451
1459
};
1452
1460
#endif
1453
1461
1454
1462
template <typename R = void , typename A = void , typename ... P>
1455
1463
class Delegate : public detail ::DelegatePImpl<A, R, P...>
1456
1464
{
1465
+ public:
1457
1466
using detail::DelegatePImpl<A, R, P...>::DelegatePImpl;
1458
1467
};
1459
1468
1460
1469
template <typename R, typename A>
1461
1470
class Delegate <R, A> : public detail::DelegateImpl<A, R>
1462
1471
{
1472
+ public:
1463
1473
using detail::DelegateImpl<A, R>::DelegateImpl;
1464
1474
};
1465
1475
@@ -1468,10 +1478,12 @@ namespace detail
1468
1478
template <typename R, typename A = void , typename ... P> class Delegate ;
1469
1479
template <typename R, typename A, typename ... P> class Delegate <R(P...), A> : public detail::Delegate<R, A, P...>
1470
1480
{
1481
+ public:
1471
1482
using detail::Delegate<R, A, P...>::Delegate;
1472
1483
};
1473
1484
template <typename R, typename ... P> class Delegate <R(P...)> : public detail::Delegate<R, void , P...>
1474
1485
{
1486
+ public:
1475
1487
using detail::Delegate<R, void , P...>::Delegate;
1476
1488
};
1477
1489
0 commit comments