Uphill

via Digitalmars-d digitalmars-d at puremagic.com
Sun May 31 02:13:32 PDT 2015


On Sunday, 31 May 2015 at 08:51:00 UTC, Atila Neves wrote:
> While C++ programmers should try and avoid the preprocessor as 
> much as possible, sometimes it just isn't possible to do so. 
> There's just no other way to generate code sometimes. I know, 
> I've tried.

In what case is this true? If it is only to avoid some boiler 
plate then it is not a good excuse, IMO. You can usually avoid 
macros by restructuring composition (using multiple layers of 
templates).

Anyway, cpp is a separate language from c++ so it only affects 
AST related tooling that modify source files where macros are 
present. It is overall more separate than builtin textual 
substitution (which is generally a bad idea) since it is a 
discrete independent step that a tool easily can apply before 
analysis.


More information about the Digitalmars-d mailing list