Commit 72eedeb
committed
fix(log): use constructor template instead of class template for initiator
- src/libipc/platform/win/get_sa.h:
* Change from class template to constructor template
* Keep 'struct initiator' as a regular class (not template)
* Make constructor a function template: template <typename Logger> initiator(Logger const &log)
* Instantiate as: static initiator handle(log);
* This is valid C++ as function templates can be defined inside functions
* Fixes the issue that class templates cannot be defined inside functions
The constructor template approach allows proper logger passing while
maintaining valid C++ syntax for local struct definitions.1 parent afd1467 commit 72eedeb
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments