Make ScalarConverter non-initializable and OCF
authorLukas Jiriste <ljiriste@student.42prague.com>
Wed, 22 Jan 2025 11:55:44 +0000 (12:55 +0100)
committerLukas Jiriste <ljiriste@student.42prague.com>
Wed, 22 Jan 2025 11:55:44 +0000 (12:55 +0100)
ex00/ScalarConverter.cpp
ex00/ScalarConverter.h

index 8b1d48e5efda5b98ecc50f2ce589520f73229e19..ecb65f6fbbe9ae88c9db88971bbe66a2f1ad0bcb 100644 (file)
@@ -6,6 +6,26 @@
 #include <iomanip>
 #include <sstream>
 
+ScalarConverter::ScalarConverter()
+{
+}
+
+ScalarConverter::ScalarConverter(const ScalarConverter &other)
+{
+       *this = other;
+}
+
+ScalarConverter::~ScalarConverter()
+{
+}
+
+ScalarConverter        &ScalarConverter::operator=(const ScalarConverter &other)
+{
+       if (this == &other)
+               return (*this);
+       return (*this);
+}
+
 bool   ScalarConverter::convert(const std::string &str)
 {
        double                          d_rep;
index 128c729d94ba413b5759be9de858f1c630772dd1..93f4d7873b98efb5d3dd5f4c8ce5f669cb9f99a2 100644 (file)
@@ -5,6 +5,13 @@
 
 class ScalarConverter
 {
+       private:
+               ScalarConverter();
+               ScalarConverter(const ScalarConverter &other);
+               ~ScalarConverter();
+
+               ScalarConverter &operator=(const ScalarConverter &other);
+
        public:
                static bool     convert(const std::string &str);
 };