accessing your scope for template metaprogramming ?

bearophile bearophileHUGS at lycos.com
Sat Apr 16 15:41:35 PDT 2011


Sean Cavanaugh:

> Is there any way to access the your current scope?  For instance the 
> following pseudocode is what I am after more or less:
> 
> 
> class Foo
> {
>    alias byte function(int) BarCompatibleInterface;
> 
>    byte Bar(int)
>    {
>      static assert(is(typeof(localscope) == function));

You have just invented another purpose for something like a _function_, that refers to the current function that I have originally desired to solve this different problem.

See my Comments 1 and 2 here:
http://d.puremagic.com/issues/show_bug.cgi?id=5140

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list