"Atila Neves" <atila.ne...@gmail.com> writes: > On Sunday, 31 May 2015 at 09:13:33 UTC, Ola Fosheim Grøstad wrote: >> 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). > > I'll take a macro over boilerplate any day of the week and twice on > Sundays.
Timely! I and stack overflow struggled for a couple hours to find an equivalent C++ template for something that was straightforward with a couple macros.