This commit is contained in:
parent
477834ac04
commit
a2e53acb34
@ -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]]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user