Skip to content

Commit b309ec0

Browse files
authored
handle deleted copy constructors and assignment operators (#1233)
1 parent e95e695 commit b309ec0

16 files changed

+43
-47
lines changed

src/sst/core/checkpointAction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,9 @@ class CheckpointAction : public Action
8484
NotSerializable(SST::CheckpointAction);
8585

8686
private:
87-
CheckpointAction() {}
88-
CheckpointAction(const CheckpointAction&);
87+
CheckpointAction(const CheckpointAction&) = delete;
88+
CheckpointAction& operator=(const CheckpointAction&) = delete;
8989

90-
void operator=(CheckpointAction const&);
9190
void createCheckpoint(Simulation_impl* sim); // The actual checkpoint operation
9291

9392
RankInfo rank_; // RankInfo for this thread/rank

src/sst/core/exit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ class Exit : public Action
9898
void serialize_order(SST::Core::Serialization::serializer& ser) override;
9999
ImplementSerializable(SST::Exit)
100100
private:
101-
Exit() {} // for serialization only
102-
Exit(const Exit&); // Don't implement
103-
void operator=(Exit const&); // Don't implement
101+
Exit() = default; // for serialization only
102+
Exit(const Exit&) = delete; // Don't implement
103+
Exit& operator=(const Exit&) = delete; // Don't implement
104104

105105
// bool handler( Event* );
106106

src/sst/core/factory.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,8 @@ class Factory
314314
Factory(const std::string& searchPaths);
315315
~Factory();
316316

317-
Factory(); // Don't Implement
318-
Factory(Factory const&); // Don't Implement
319-
void operator=(Factory const&); // Don't Implement
317+
Factory(const Factory&) = delete; // Don't Implement
318+
Factory& operator=(const Factory&) = delete; // Don't Implement
320319

321320
static Factory* instance;
322321

src/sst/core/heartbeat.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ class SimulatorHeartbeat : public Action
4545
ImplementSerializable(SST::SimulatorHeartbeat)
4646

4747
private:
48-
SimulatorHeartbeat() {};
49-
SimulatorHeartbeat(const SimulatorHeartbeat&);
48+
SimulatorHeartbeat() = default;
49+
SimulatorHeartbeat(const SimulatorHeartbeat&) = delete;
50+
SimulatorHeartbeat& operator=(const SimulatorHeartbeat&) = delete;
5051

51-
void operator=(SimulatorHeartbeat const&);
5252
void execute() override;
5353
int rank;
5454
TimeConverter* m_period;

src/sst/core/interactiveConsole.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,8 @@ class InteractiveConsole
123123
SST::Core::Serialization::ObjectMap* getComponentObjectMap();
124124

125125
private:
126-
InteractiveConsole(const InteractiveConsole&);
127-
128-
void operator=(InteractiveConsole const&);
126+
InteractiveConsole(const InteractiveConsole&) = delete;
127+
InteractiveConsole& operator=(const InteractiveConsole&) = delete;
129128
};
130129

131130
} // namespace SST

src/sst/core/simulation_impl.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,9 @@ class Simulation_impl
332332
// To enable main to set up globals
333333
friend int ::main(int argc, char** argv);
334334

335-
Simulation_impl() {}
336335
Simulation_impl(Config* config, RankInfo my_rank, RankInfo num_ranks, bool restart);
337-
Simulation_impl(Simulation_impl const&); // Don't Implement
338-
void operator=(Simulation_impl const&); // Don't implement
336+
Simulation_impl(const Simulation_impl&) = delete; // Don't Implement
337+
Simulation_impl& operator=(const Simulation_impl&) = delete; // Don't implement
339338

340339
/** Get a handle to a TimeConverter
341340
* @param cycles Frequency which is the base of the TimeConverter

src/sst/core/testElements/coreTest_ClockerComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ class coreTestClockerComponent : public SST::Component
5151
void finish() {}
5252

5353
private:
54-
coreTestClockerComponent(); // for serialization only
55-
coreTestClockerComponent(const coreTestClockerComponent&); // do not implement
56-
void operator=(const coreTestClockerComponent&); // do not implement
54+
coreTestClockerComponent(); // for serialization only
55+
coreTestClockerComponent(const coreTestClockerComponent&) = delete; // do not implement
56+
coreTestClockerComponent& operator=(const coreTestClockerComponent&) = delete; // do not implement
5757

5858
virtual bool tick(SST::Cycle_t);
5959

src/sst/core/testElements/coreTest_Component.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class coreTestComponent : public coreTestComponentBase2
123123
coreTestComponent(); // for serialization only
124124

125125
private:
126-
coreTestComponent(const coreTestComponent&); // do not implement
127-
void operator=(const coreTestComponent&); // do not implement
126+
coreTestComponent(const coreTestComponent&) = delete; // do not implement
127+
coreTestComponent& operator=(const coreTestComponent&) = delete; // do not implement
128128

129129
void handleEvent(SST::Event* ev);
130130
virtual bool clockTic(SST::Cycle_t);

src/sst/core/testElements/coreTest_DistribComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ class coreTestDistribComponent : public SST::Component
6161
void setup() {}
6262

6363
private:
64-
coreTestDistribComponent(); // for serialization only
65-
coreTestDistribComponent(const coreTestDistribComponent&); // do not implement
66-
void operator=(const coreTestDistribComponent&); // do not implement
64+
coreTestDistribComponent(); // for serialization only
65+
coreTestDistribComponent(const coreTestDistribComponent&) = delete; // do not implement
66+
coreTestDistribComponent& operator=(const coreTestDistribComponent&) = delete; // do not implement
6767

6868
virtual bool tick(SST::Cycle_t);
6969

src/sst/core/testElements/coreTest_MessageGeneratorComponent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ class coreTestMessageGeneratorComponent : public SST::Component
5757
}
5858

5959
private:
60-
coreTestMessageGeneratorComponent(); // for serialization only
61-
coreTestMessageGeneratorComponent(const coreTestMessageGeneratorComponent&); // do not implement
62-
void operator=(const coreTestMessageGeneratorComponent&); // do not implement
60+
coreTestMessageGeneratorComponent(); // for serialization only
61+
coreTestMessageGeneratorComponent(const coreTestMessageGeneratorComponent&) = delete; // do not implement
62+
coreTestMessageGeneratorComponent& operator=(const coreTestMessageGeneratorComponent&) = delete; // do not implement
6363

6464
void handleEvent(SST::Event* ev);
6565
virtual bool tick(SST::Cycle_t);

0 commit comments

Comments
 (0)