Skip to content

Commit 89664c6

Browse files
[Globals]: add copy c-tor and copy operator (#585)
: copy constructor added to be explicit as needed by C++17 and later
1 parent c1d7600 commit 89664c6

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

include/CXXGraph/Partitioning/Utility/Globals.hpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,31 @@ class Globals {
3939
const double param1 = 1, const double param2 = 1, const double param3 = 1,
4040
const unsigned int threads = std::thread::hardware_concurrency());
4141
~Globals();
42+
Globals(const Globals& that) {
43+
numberOfPartition = that.numberOfPartition; // number of partitions
44+
partitionStategy = that.partitionStategy;
45+
threads = that.threads;
46+
param1 = that.param1;
47+
param2 = that.param2;
48+
param3 = that.param3;
49+
50+
edgeCardinality = that.edgeCardinality;
51+
vertexCardinality = that.vertexCardinality;
52+
edgeAnalyzed = that.edgeAnalyzed;
53+
};
54+
Globals& operator=(const Globals& that) {
55+
numberOfPartition = that.numberOfPartition; // number of partitions
56+
partitionStategy = that.partitionStategy;
57+
threads = that.threads;
58+
param1 = that.param1;
59+
param2 = that.param2;
60+
param3 = that.param3;
61+
62+
edgeCardinality = that.edgeCardinality;
63+
vertexCardinality = that.vertexCardinality;
64+
edgeAnalyzed = that.edgeAnalyzed;
65+
return *this;
66+
}
4267

4368
const std::string print() const;
4469

0 commit comments

Comments
 (0)