version(number) is completely useless
H. S. Teoh
hsteoh at qfbox.info
Tue Jul 26 17:06:17 UTC 2022
On Tue, Jul 26, 2022 at 03:19:44PM +0000, Andrey Zherikov via Digitalmars-d wrote:
> On Tuesday, 26 July 2022 at 13:27:55 UTC, H. S. Teoh wrote:
[...]
> > ```
> > static if (__VERSION__ == 2098L) {
> > ... // 2.098-specific code
> > }
> > static if (__VERSION__ == 2100L) {
> > ... // 2.100-specific code
> > }
> > // and so on
> > ```
>
> This is discouraged usage according to Walter, isn't it?
I guess so. :-D
So maybe we need a DIP to add feature-based version identifiers, e.g.:
version(fixed12345) { ... /* bug 12345 is fixed */ }
version(dip1000) { ... }
version(intpromote) { ... }
and so on.
T
--
He who sacrifices functionality for ease of use, loses both and deserves neither. -- Slashdotter
More information about the Digitalmars-d
mailing list