struct Base
{
virtual void Call(void*) const = 0;
};
//template
//struct Derived :
//! in practice, those are templated classes specifying the type; but it makes no difference on the result so has been simplified here
struct DerivedStatic :
public Base
{
private:
void Call(void* pData) const override final
{
CallTyped(*reinterpret_cast(pData));
}
virtual void CallTyped(int data) const = 0;
};
struct UserStatic final :
public DerivedStatic
{
private:
void CallTyped(int data) const override
{
std::cout
Betrachten Sie das folgende Beispiel (Demo): [code]struct Base { virtual void Call(void*) const = 0; };
//template //struct Derived : //! in practice, those are templated classes specifying the type; but it makes no difference on the result so has been simplified here struct DerivedStatic : public Base { private: void Call(void* pData) const override final { CallTyped(*reinterpret_cast(pData)); }
virtual void CallTyped(int data) const = 0; };
struct UserStatic final : public DerivedStatic { private: void CallTyped(int data) const override { std::cout
UPDATE: Aufgrund verschiedener Rückmeldungen aktualisiere ich meine Frage erheblich, so dass sie sich von der ursprünglichen Frage unterscheidet (aber immer noch damit zusammenhängt). Ich weiß nicht,...