Fun with range deprecations

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Tue Aug 12 04:44:16 PDT 2014


On Tue, Aug 12, 2014 at 08:20:09AM +0000, Fra via Digitalmars-d wrote:
[..]
> Noob question... shouldn't __traits(compile) enable us to handle the
> situation correctly?

It does, in a sense. A deprecated feature still compiles, so
__traits(compiles) is returning the correct value (true). Except that it
doesn't tell you if a deprecation warning will happen if you actually
use the tested feature.

A scarier thought is what happens what __traits(compiles) returns /
ought to return when compiling with -de (abort compilation on using
deprecated features). Code that use __traits(compiles) would change
behaviour depending on compiler flags, which is something Walter frowns
on.


T

-- 
One reason that few people are aware there are programs running the
internet is that they never crash in any significant way: the free
software underlying the internet is reliable to the point of
invisibility. -- Glyn Moody, from the article "Giving it all away"


More information about the Digitalmars-d mailing list