From f9f5cc77924f592053979be70f94af778decd8d4 Mon Sep 17 00:00:00 2001 From: Patrick Urbanke Date: Wed, 3 Jan 2024 17:43:50 +0100 Subject: [PATCH] Got rid of stray OutputValue.hpp --- include/rfl/flexbuf/OutputValue.hpp | 67 ----------------------------- 1 file changed, 67 deletions(-) delete mode 100644 include/rfl/flexbuf/OutputValue.hpp diff --git a/include/rfl/flexbuf/OutputValue.hpp b/include/rfl/flexbuf/OutputValue.hpp deleted file mode 100644 index 72d852d2..00000000 --- a/include/rfl/flexbuf/OutputValue.hpp +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef FLEXBUF_OUTPUTVALUE_HPP_ -#define FLEXBUF_OUTPUTVALUE_HPP_ - -#include - -#include -#include -#include - -#include "../Ref.hpp" -#include "../always_false.hpp" -#include "OutputVar.hpp" - -namespace rfl { -namespace flexbuf { - -template -class OutputValue : public OutputVar { - public: - OutputValue(T _val) : val_(_val) {} - - ~OutputValue() = default; - - /// Inserts all elements into the builder. - void insert(const std::optional& _key, - flexbuffers::Builder* _fbb) final { - if constexpr (std::is_same, std::string>()) { - if (_key) { - _fbb->String(_key->c_str(), val_); - } else { - _fbb->String(val_); - } - } else if constexpr (std::is_same, bool>()) { - if (_key) { - _fbb->Bool(_key->c_str(), val_); - } else { - _fbb->Bool(val_); - } - } else if constexpr (std::is_floating_point>()) { - if (_key) { - _fbb->Double(_key->c_str(), val_); - } else { - _fbb->Double(val_); - } - } else if constexpr (std::is_integral>()) { - if (_key) { - _fbb->Int(_key->c_str(), val_); - } else { - _fbb->Int(val_); - } - } else { - static_assert(always_false_v, "Unsupported type"); - } - }; - - /// Whether this is null. - bool is_null() const final { return false; } - - private: - /// The underlying value. - T val_; -}; - -} // namespace flexbuf -} // namespace rfl - -#endif