File tree Expand file tree Collapse file tree 7 files changed +31
-21
lines changed Expand file tree Collapse file tree 7 files changed +31
-21
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,7 @@ BITCOIN_CORE_H = \
279
279
txorphanage.h \
280
280
txrequest.h \
281
281
undo.h \
282
+ util/any.h \
282
283
util/asmap.h \
283
284
util/batchpriority.h \
284
285
util/bip32.h \
Original file line number Diff line number Diff line change 24
24
#include < streams.h>
25
25
#include < sync.h>
26
26
#include < txmempool.h>
27
+ #include < util/any.h>
27
28
#include < util/check.h>
28
- #include < util/system.h>
29
29
#include < validation.h>
30
30
#include < version.h>
31
31
Original file line number Diff line number Diff line change 19
19
#include < rpc/util.h>
20
20
#include < scheduler.h>
21
21
#include < univalue.h>
22
+ #include < util/any.h>
22
23
#include < util/check.h>
23
24
#include < util/syscall_sandbox.h>
24
- #include < util/system.h>
25
25
26
26
#include < stdint.h>
27
27
#ifdef HAVE_MALLOC_INFO
Original file line number Diff line number Diff line change 11
11
#include < rpc/protocol.h>
12
12
#include < rpc/request.h>
13
13
#include < txmempool.h>
14
- #include < util/system .h>
14
+ #include < util/any .h>
15
15
#include < validation.h>
16
16
17
17
#include < any>
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2023 The Bitcoin Core developers
2
+ // Distributed under the MIT software license, see the accompanying
3
+ // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
+
5
+ #ifndef BITCOIN_UTIL_ANY_H
6
+ #define BITCOIN_UTIL_ANY_H
7
+
8
+ #include < any>
9
+
10
+ namespace util {
11
+
12
+ /* *
13
+ * Helper function to access the contained object of a std::any instance.
14
+ * Returns a pointer to the object if passed instance has a value and the type
15
+ * matches, nullptr otherwise.
16
+ */
17
+ template <typename T>
18
+ T* AnyPtr (const std::any& any) noexcept
19
+ {
20
+ T* const * ptr = std::any_cast<T*>(&any);
21
+ return ptr ? *ptr : nullptr ;
22
+ }
23
+
24
+ } // namespace util
25
+
26
+ #endif // BITCOIN_UTIL_ANY_H
Original file line number Diff line number Diff line change 13
13
#include < compat/assumptions.h>
14
14
#include < compat/compat.h>
15
15
16
- #include < any>
17
16
#include < set>
18
17
#include < stdint.h>
19
18
#include < string>
@@ -36,20 +35,4 @@ void runCommand(const std::string& strCommand);
36
35
*/
37
36
int GetNumCores ();
38
37
39
- namespace util {
40
-
41
- /* *
42
- * Helper function to access the contained object of a std::any instance.
43
- * Returns a pointer to the object if passed instance has a value and the type
44
- * matches, nullptr otherwise.
45
- */
46
- template <typename T>
47
- T* AnyPtr (const std::any& any) noexcept
48
- {
49
- T* const * ptr = std::any_cast<T*>(&any);
50
- return ptr ? *ptr : nullptr ;
51
- }
52
-
53
- } // namespace util
54
-
55
38
#endif // BITCOIN_UTIL_SYSTEM_H
Original file line number Diff line number Diff line change 6
6
7
7
#include < common/url.h>
8
8
#include < rpc/util.h>
9
- #include < util/system .h>
9
+ #include < util/any .h>
10
10
#include < util/translation.h>
11
11
#include < wallet/context.h>
12
12
#include < wallet/wallet.h>
You can’t perform that action at this time.
0 commit comments