I was reading through the boost library docs about their preprocessor library and it seems that the only valuable argument they present for people to use it over building their own custom code generator is that users would have to integrate it in their development environment and there would have to be various builds for various platforms, contrarily to the preprocessor wich already exists and should work in most C compliant preprocessors, given enouph care.
But the other day I was debugging some of my own macros and checking the preprocessor output from some compilers when all of a sudden it got me. A custom made code that would interpret custom keywords in the source (custom macro preprocessor) could be integrated simply using the #line directive wich seems to have been tailored specifically to this task!! Using it would allow line numbers to appear correctly on compiler messges.
My C book actually mentions that the #line directive is intended for debugging purposes. Must be the same use here: some utility that analised a source could actually use the #line and #error directives to make the compiler display errors regarding any line it wanted.
SO now I'm left with a big doubt. Surely there must be some advantages to using the boost preprocessor library (and preprocessor macros in general) otherwise the boost devs wouldn't have gone through all the trouble of creating it ? Or is it just that if there's an alternative way to do things, some people will try it anyway, even if it's worse ?
:pint: