Skip to content

Commit 2c6dd05

Browse files
committed
fix: avoid potential "no user-provided default constructor" error
1 parent 50db326 commit 2c6dd05

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/evo/deterministicmns.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,13 +394,14 @@ class CDeterministicMNList
394394
template <typename T>
395395
[[nodiscard]] uint256 GetUniquePropertyHash(const T& v) const
396396
{
397-
static_assert(!std::is_same<T, CBLSPublicKey>(), "GetUniquePropertyHash cannot be templated against CBLSPublicKey");
397+
static_assert(!std::is_same_v<std::decay_t<T>, CBLSPublicKey>,
398+
"GetUniquePropertyHash cannot be templated against CBLSPublicKey");
398399
return ::SerializeHash(v);
399400
}
400401
template <typename T>
401402
[[nodiscard]] bool AddUniqueProperty(const CDeterministicMN& dmn, const T& v)
402403
{
403-
static const T nullValue;
404+
static const T nullValue{};
404405
if (v == nullValue) {
405406
return false;
406407
}
@@ -420,7 +421,7 @@ class CDeterministicMNList
420421
template <typename T>
421422
[[nodiscard]] bool DeleteUniqueProperty(const CDeterministicMN& dmn, const T& oldValue)
422423
{
423-
static const T nullValue;
424+
static const T nullValue{};
424425
if (oldValue == nullValue) {
425426
return false;
426427
}
@@ -443,7 +444,7 @@ class CDeterministicMNList
443444
if (oldValue == newValue) {
444445
return true;
445446
}
446-
static const T nullValue;
447+
static const T nullValue{};
447448

448449
if (oldValue != nullValue && !DeleteUniqueProperty(dmn, oldValue)) {
449450
return false;

0 commit comments

Comments
 (0)