From 072cc718ba69b86c06f270c56140ea8d4d2e1ad5 Mon Sep 17 00:00:00 2001 From: Antonio SJ Musumeci Date: Tue, 14 Oct 2025 20:28:08 -0500 Subject: [PATCH] checkpoint --- src/tofrom_ref.hpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/tofrom_ref.hpp diff --git a/src/tofrom_ref.hpp b/src/tofrom_ref.hpp new file mode 100644 index 00000000..29e6e956 --- /dev/null +++ b/src/tofrom_ref.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include "to_string.hpp" +#include "from_string.hpp" +#include "tofrom_string.hpp" + + +template +class TFSRef : public ToFromString +{ +public: + int + from_string(const std::string_view s_) final + { + return str::from(s_,&_data); + } + + std::string + to_string(void) const final + { + return str::to(_data); + } + +public: + TFSRef(T &data_) + : _data(data_) + { + } + + TFSRef(T &data_, + const T val_) + : _data(data_) + { + _data = val_; + } + +private: + T &_data; +};