Small code simplification
This commit is contained in:
parent
b1a57a2b80
commit
89fa6d4fbf
|
@ -40,7 +40,7 @@ private:
|
||||||
OptionFlags m_flags;
|
OptionFlags m_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Option
|
class Option : public UseMemoryDomain<MemoryDomain::Options>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Option() = default;
|
virtual ~Option() = default;
|
||||||
|
@ -143,18 +143,6 @@ public:
|
||||||
if (option_add(m_value, str))
|
if (option_add(m_value, str))
|
||||||
m_manager.on_option_changed(*this);
|
m_manager.on_option_changed(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
using Alloc = Allocator<TypedOption, MemoryDomain::Options>;
|
|
||||||
static void* operator new (std::size_t sz)
|
|
||||||
{
|
|
||||||
kak_assert(sz == sizeof(TypedOption));
|
|
||||||
return Alloc{}.allocate(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void operator delete (void* ptr)
|
|
||||||
{
|
|
||||||
return Alloc{}.deallocate(reinterpret_cast<TypedOption*>(ptr), 1);
|
|
||||||
}
|
|
||||||
private:
|
private:
|
||||||
virtual void validate(const T& value) const {}
|
virtual void validate(const T& value) const {}
|
||||||
T m_value;
|
T m_value;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user