Final by default?

Johannes Pfau nospam at example.com
Fri Mar 14 10:26:19 PDT 2014


Am Fri, 14 Mar 2014 23:34:46 +0900
schrieb Mike Parker <aldacron at gmail.com>:

> When I do need something like this, I just define some manifest 
> constants in a config module, import that everywhere, and use static
> if. But that feels very much like the workaround it is. I would much
> prefer to have boolean versions. The bottom line is that I'm doing
> exactly what Walter apparently doesn't want me to do anyway, just
> with the added annoyance of importing an extra module to get it done.

I use manifest constants instead of version identifiers as well. If a
version identifier affects the public API/ABI of a library, then the
library and all code using the library always have to be compiled with
the same version switches(inlining and templates make this an even
bigger problem). This is not only inconvenient, it's also easy to think
of examples where the problem will only show up as crashes at runtime.
The only reason why that's not an issue in phobos/druntime is that we
only use compiler defined versions there, but user defined versions are
almost unusable.


More information about the Digitalmars-d mailing list