I personally prefer macros to typedefs simply because it is easier to memorize for me, plus you can make some pretty nifty functions with macros. Example:
//"CObject" is a base class for the objects to be registeredID object_register(CObject* (*_ptrFunc)(),string _name="",ID _parent=-1);#define OBJECT_REGISTER(name,class,parent) CObject* __NEW_##name() { return new class; } ID name=object_register(&__NEW_##name,#name,parent)//Note: This is in the declarations, not a function body.class CParent : public CObject { ... //Meat of class here};class CTimmy : public CParent { ... };//Register these objectsOBJECT_REGISTER(Parent,CParent,-1); //Declares: "CObject* __NEW_Parent()", and "ID Parent"OBJECT_REGISTER(Timmy,CTimmy,Parent); //Declares: "CObject* __NEW_Timmy()", and "ID Timmy"
As you can clearly see, this can NOT be acheived with any inline functions, therefore the macros are needed here.
Litany of precautions for supplial of source code snippets included here
"Litany" is teh roxors.