How templates work (1)

Stefan Koch uplink.coder at googlemail.com
Fri May 29 21:31:45 UTC 2020


On Friday, 29 May 2020 at 21:18:42 UTC, Max Samukha wrote:
> On Friday, 29 May 2020 at 19:17:26 UTC, Stefan Koch wrote:
>> On Friday, 29 May 2020 at 16:57:38 UTC, Bruce Carneal wrote:
>>> On Friday, 29 May 2020 at 16:04:06 UTC, Stefan Koch wrote:
>>>> On Friday, 29 May 2020 at 15:17:55 UTC, Ben Jones wrote:
>>>>> [...]
>>>>
>>>> Those details would fill a few pages I am afraid.
>>>>
>>>> I'd like to talk about the what has to happen rather than 
>>>> how it happens.
>>>> So that way it's a bit like reading the summery of a horror 
>>>> movie rather than watching the whole thing.
>>>
>>> I would love to see a blog on this.
>>>
>>> I would also love to see a follow on blog, if you have time, 
>>> on the performance gains you're realizing in the area.  Your 
>>> recent posts in other threads are very exciting.
>>
>> Any Questions or suggestions are appreciated.
>
> I!"boo" -> { alias I = "boo"; }.I?
>
> Why do we still have to alias a = Alias!"boo"?

You are correct.
That is what will happen and the instance of I will alias to the 
string "boo".

I might be wrong. But I believe the reason we have to do this is 
a parser issue.
The parser expects a type after the alias {ident} = .
The template instance will parse as a type while the string "boo" 
does not.


More information about the Digitalmars-d mailing list