File tree Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Expand file tree Collapse file tree 4 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -365,6 +365,7 @@ BITCOIN_CORE_H = \
365365 util/moneystr.h \
366366 util/overflow.h \
367367 util/overloaded.h \
368+ util/pointer.h \
368369 util/ranges.h \
369370 util/readwritefile.h \
370371 util/underlying.h \
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ class CDeterministicMNList
180180 }
181181 }
182182
183- template <typename Stream>
183+ template <typename Stream>
184184 void Unserialize (Stream& s)
185185 {
186186 Clear ();
Original file line number Diff line number Diff line change 1+ // Copyright (c) 2025 The Dash 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_POINTER_H
6+ #define BITCOIN_UTIL_POINTER_H
7+
8+ #include < memory>
9+
10+ namespace util {
11+ /* Deep equality comparison helper for std::shared_ptr<T> */
12+ template <typename T>
13+ bool shared_ptr_equal (const std::shared_ptr<T>& lhs, const std::shared_ptr<T>& rhs)
14+ requires requires { *lhs == *rhs; }
15+ {
16+ /* Same object or both blank */
17+ if (lhs == rhs) return true ;
18+ /* Inequal initialization state */
19+ if (!lhs || !rhs) return false ;
20+ /* Deep comparison */
21+ return *lhs == *rhs;
22+ }
23+
24+ /* Deep inequality comparison helper for std::shared_ptr<T> */
25+ template <typename T>
26+ bool shared_ptr_not_equal (const std::shared_ptr<T>& lhs, const std::shared_ptr<T>& rhs)
27+ requires requires { *lhs != *rhs; }
28+ {
29+ /* Same object or both blank */
30+ if (lhs == rhs) return false ;
31+ /* Inequal initialization state */
32+ if (!lhs || !rhs) return true ;
33+ /* Deep comparison */
34+ return *lhs != *rhs;
35+ }
36+ } // namespace util
37+
38+ #endif // BITCOIN_UTIL_POINTER_H
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ src/unordered_lru_cache.h
4242src/util/edge.*
4343src/util/enumerate.h
4444src/util/irange.h
45+ src/util/pointer.h
4546src/util/ranges.h
4647src/util/ranges_set.*
4748src/util/wpipe.*
You can’t perform that action at this time.
0 commit comments