On Sunday, 14 May 2017 at 21:55:01 UTC, ag0aep6g wrote:
On 05/14/2017 11:35 PM, Moritz Maxeiner wrote:
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote:
[...]
T* ptrCast(T, alias ptr)() { return cast(T*)ptr; }
[...]
    alias _state = ptrCast!(int, state);
[...]
That's a pretty cool workaround, but not an alias to the cast, but an
alias to a parametrized function template (a type),

Not sure if I'm reading that right, but `_state` is not an alias of a (parametrized function) template.

The template instantiation results in a function. `_state` is an alias of that function. `alias foo = ptrCast;` would make an alias of the template. Neither of them is a type.

You're right. I forgot about the alias to a symbol rule (event though I myself just linked to it :/ ). Sorry about that.

Reply via email to