delete undesired default members instead of making them inaccessible

This commit is contained in:
Axel Kohlmeyer
2022-06-01 02:30:25 -04:00
parent 5abb6c76af
commit 9da3dd796a
3 changed files with 17 additions and 18 deletions

View File

@ -15,8 +15,8 @@
#define TEST_CONFIG_H #define TEST_CONFIG_H
#include <set> #include <set>
#include <string>
#include <sstream> #include <sstream>
#include <string>
#include <utility> #include <utility>
#include <vector> #include <vector>
@ -96,23 +96,21 @@ public:
restart_vel.clear(); restart_vel.clear();
global_vector.clear(); global_vector.clear();
} }
virtual ~TestConfig(){}; TestConfig(const TestConfig &) = delete;
TestConfig &operator=(const TestConfig &) = delete;
std::string tags_line() const std::string tags_line() const
{ {
if(tags.size() > 0) { if (tags.size() > 0) {
std::stringstream line; std::stringstream line;
line << tags[0]; line << tags[0];
for(size_t i = 1; i < tags.size(); i++) { for (size_t i = 1; i < tags.size(); i++) {
line << ", " << tags[i]; line << ", " << tags[i];
} }
return line.str(); return line.str();
} }
return "generated"; return "generated";
} }
private:
TestConfig(const TestConfig &){};
}; };
#endif #endif

View File

@ -22,6 +22,8 @@ class TestConfigReader : public YamlReader<TestConfigReader> {
public: public:
TestConfigReader(TestConfig &config); TestConfigReader(TestConfig &config);
TestConfigReader() = delete;
const TestConfigReader & operator=(TestConfig &) = delete;
void skip_tests(const yaml_event_t &event); void skip_tests(const yaml_event_t &event);
void prerequisites(const yaml_event_t &event); void prerequisites(const yaml_event_t &event);

View File

@ -22,6 +22,9 @@ class YamlWriter {
public: public:
YamlWriter(const char *outfile); YamlWriter(const char *outfile);
virtual ~YamlWriter(); virtual ~YamlWriter();
YamlWriter() = delete;
YamlWriter(const YamlWriter &) = delete;
const YamlWriter & operator=(const YamlWriter &) = delete;
// emitters // emitters
void emit(const std::string &key, const double value); void emit(const std::string &key, const double value);
@ -34,10 +37,6 @@ private:
FILE *fp; FILE *fp;
yaml_emitter_t emitter; yaml_emitter_t emitter;
yaml_event_t event; yaml_event_t event;
private:
YamlWriter(){};
YamlWriter(const YamlWriter &){};
}; };
#endif #endif