[keel] Improve correctness
All checks were successful
Build / build (push) Successful in 1m20s

This commit is contained in:
Gary Talent 2025-04-17 01:12:05 -05:00
parent 477834ac04
commit a2e53acb34

View File

@ -129,7 +129,7 @@ class BaseConverter {
template<auto Func> template<auto Func>
class ConverterFunc: public BaseConverter { class ConverterFunc final: public BaseConverter {
private: private:
template<typename SrcType, typename DstType> template<typename SrcType, typename DstType>
struct ParamPack { struct ParamPack {
@ -200,14 +200,14 @@ class Converter {
BaseConverter *m_conv{}; BaseConverter *m_conv{};
public: public:
template<auto Func> template<auto Func>
static Converter make() { static Converter make() noexcept {
Converter out; Converter out;
static_assert(sizeof(ConverterFunc<Func>) <= sizeof(out.m_buff)); static_assert(sizeof(ConverterFunc<Func>) <= sizeof(out.m_buff));
out.m_conv = new (out.m_buff.data()) ConverterFunc<Func>{}; out.m_conv = new (out.m_buff.data()) ConverterFunc<Func>{};
return out; return out;
} }
constexpr Converter() {} constexpr Converter() {}
Converter(Converter const &other): Converter(Converter const &other) noexcept:
m_buff{other.m_buff}, m_buff{other.m_buff},
m_conv{m_buff.data()} {} m_conv{m_buff.data()} {}
[[nodiscard]] [[nodiscard]]