MCPcopy Create free account
hub / github.com/SergeyMakeev/ExcaliburHash / ComplexValue

Class ComplexValue

ExcaliburHashTest04.cpp:6–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <cstring>
5
6struct ComplexValue
7{
8 ComplexValue(const ComplexValue& other)
9 : isMoved(other.isMoved)
10 , isDeleted(other.isDeleted)
11 {
12 EXPECT_FALSE(other.isMoved);
13 EXPECT_FALSE(other.isDeleted);
14 }
15
16 ComplexValue& operator=(const ComplexValue& other) noexcept
17 {
18 EXPECT_FALSE(other.isMoved);
19 EXPECT_FALSE(other.isDeleted);
20 isMoved = other.isMoved;
21 isDeleted = other.isDeleted;
22 return *this;
23 }
24
25 ComplexValue() noexcept
26 : isMoved(false)
27 , isDeleted(false)
28 {
29 }
30
31 ComplexValue(ComplexValue&& other) noexcept
32 : isMoved(other.isMoved)
33 , isDeleted(other.isDeleted)
34 {
35 EXPECT_FALSE(other.isDeleted);
36 other.isMoved = true;
37 }
38
39 ~ComplexValue() noexcept { isDeleted = true; }
40
41 ComplexValue& operator=(ComplexValue&& other) noexcept
42 {
43 isDeleted = other.isDeleted;
44 isMoved = other.isMoved;
45 other.isMoved = true;
46 return *this;
47 }
48
49 bool isMoved;
50 bool isDeleted;
51};
52
53TEST(SmFlatHashMap, InsertFromItselfWhileGrow)
54{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected