Comment Re:D is a regression (Score 2) 386
A preprocessor is the only way to ignore syntax errors.
Here's how to break your compile even when UNTESTED_FEATURE is undefined:
#endif
The preprocessor can't save you from developers who check in uncompilable code. I'd argue it makes the situation worse: overuse of the preprocessor makes breaking the build easier than ever and makes figuring out why it doesn't build no fun at all. Use a branch in your version control for that.
Here's your mystructure example in D:
struct mystructure { int one; static if(GREATFEATURE) int two; };
How simple is that? Sadly, C++ doesn't have static if yet, but the D implementation proves you don't need a preprocessor for that.
I was going to show how to do that in C++ with partial specialization, but it's obvious you don't care and nothing is going to convince you that the preprocessor is evil
That's fine, you can keep it.