You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 29, 2026. It is now read-only.
Naturally, different attribute types have different data types, therefore have different get and set (mostly T get() and void set(T)). I have to put them all together into a single container, so some polymorphism type is needed. But virtual functions can't help here because subclasses have different member function signatures.
Furthermore, to support arbitrary data type I have something like:
template<classT>
classTypedAttribute{
public:
T get(){return data;}
voidset(T value){data = value;}
template<class ...Args>
voidset(Args ...args){
data = T{std::forward<Args>(args)...};
}
private:
T data;
};
Is there anything I can do with proxy to handle this situation? I can't figure out a way to dispatch get and set calls to subclasses. Currently I just dynamic convert a parent class into a subclass.