#include "smart_string.hpp" #include "memory.hpp" #include SmartString::SmartString(char *c_string) { this->c_str = c_string; } SmartString::SmartString(unsigned int size) { this->c_str = malloc_s(size + 1); } SmartString::~SmartString() { if (this->c_str != nullptr) free(this->c_str); } SmartString::operator char *() const { return this->c_str; }