Relative Aliases?

tsbockman via Digitalmars-d digitalmars-d at puremagic.com
Sun May 28 08:47:49 PDT 2017


On Sunday, 28 May 2017 at 15:04:15 UTC, Jonathan Marler wrote:
> I'm also looking for the ability to get an alias to the current 
> type, i.e.
>
> struct Foo
> {
>     void foo()
>     {
>         alias TheAliasWeWant = Foo;
>         alias TheAliasWeWant = currentTypeAlias(); // possible?
>     }
> }

For types, you can use `typeof(this)` (or `typeof(cast() this)` 
if you want to strip type qualifiers).


More information about the Digitalmars-d mailing list