diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 3f57c71..7be48e0 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -1613,7 +1613,8 @@ void addWriteRange(Node *&root, int64_t oldestVersion, auto *beginNode = insert(useAsRoot, begin, writeVersion, impl); - const bool insertedBegin = !std::exchange(beginNode->entryPresent, true); + const bool insertedBegin = !beginNode->entryPresent; + beginNode->entryPresent = true; if (insertedBegin) { auto *p = nextLogical(beginNode); @@ -1630,7 +1631,8 @@ void addWriteRange(Node *&root, int64_t oldestVersion, auto *endNode = insert(useAsRoot, end, writeVersion, impl); - const bool insertedEnd = !std::exchange(endNode->entryPresent, true); + const bool insertedEnd = !endNode->entryPresent; + endNode->entryPresent = true; if (insertedEnd) { auto *p = nextLogical(endNode);