[Suggestion] More deprecation features

Stewart Gordon smjg_1998 at yahoo.com
Fri Jul 18 12:19:16 PDT 2008


"superdan" <super at dan.org> wrote in message 
news:g5qal4$o49$1 at digitalmars.com...
<snip>
> fuckin' a.  by the same token i needed version(unittest) to include
> shit only if unit testing is on.  i could also use
> version(function), version(class), version(struct), and
> version(module) to figure out from inside a mixin whether it is
> being expanded inside a function, class, struct, and respectively
> module.  but i guess this is wishful thinkin' shit.

You can detect classes and structs at least, using is(typeof(this) == class) 
and is(typeof(*this) == struct).  I don't know about the others.  And that 
said, these would also pass within a method of a class or struct, but this 
at least distinguishes it from module or module-level function scope.

Stewart.

-- 
My e-mail address is valid but not my primary mailbox.  Please keep replies 
on the 'group where everybody may benefit. 




More information about the Digitalmars-d mailing list