I'm trying to create an macro so safe me from some typing and make it nicer/easier to define an property, this is what I have in mind:
#define DefineProperty(Access, Type, Name)
property<Access, Type> ##Name;
void Set##Name(Type);
Type Get##Name(void);
Where Access is an enum with three possible values: ReadOnly, WriteOnly and ReadWrite. The method in the macro should only be defined if the access value is appropriate for the method.
Is this in any way possible for example using meta-programming?
Aucun commentaire:
Enregistrer un commentaire