mirror of
https://github.com/XRPLF/rippled.git
synced 2026-07-25 08:00:22 +00:00
added static_assert to prevent future misuse
This commit is contained in:
@@ -663,6 +663,9 @@ TaggedCache<Key, T, IsKeyCache, SharedWeakUnionPointer, SharedPointerType, Hash,
|
||||
{
|
||||
static_assert(
|
||||
!IsKeyCache, "fetchAndModify is only supported for value caches, not key-only caches");
|
||||
static_assert(
|
||||
std::is_same_v<Mutex, std::recursive_mutex>,
|
||||
"fetchAndModify requires a recursive mutex because canonicalize re-acquires mutex_ internally");
|
||||
|
||||
std::scoped_lock const lock(mutex_);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user