catchy phrase for this idiom?

Jarrett Billingsley jarrett.billingsley at gmail.com
Thu Mar 12 17:24:10 PDT 2009


On Thu, Mar 12, 2009 at 5:05 PM, Steven Schveighoffer
<schveiguy at yahoo.com> wrote:
> On Thu, 12 Mar 2009 16:37:06 -0400, Jarrett Billingsley
> <jarrett.billingsley at gmail.com> wrote:
>
>> On Thu, Mar 12, 2009 at 4:20 PM, Steven Schveighoffer
>> <schveiguy at yahoo.com> wrote:
>>>
>>> How do you do this without the Template Identity syntax?
>>> (I'm going to start calling it this to promote the term I thought was
>>> best
>>> ;)
>>
>> I'm not suggesting it be removed.  I'm suggesting that if you were
>> only able to put one symbol in the template, it would be completely
>> unnecessary.  Templates would always resolve to the single symbol that
>> they declare.
>
> So without requiring the alias how do you rewrite my example?  I'm not
> saying you are wrong, I just don't grasp what you are saying.  An example
> would be helpful.

It would go along with the suggestion of having some kind of name for
the current template.  Something like:

template Blah(T)
{
  static if(is(T : int))
     alias T this template;
  else
     alias T* this template;
}

'this template' (which reads like English, nicely) would be
lexicalized as a single token and would only be legal within
templates.  But this suggestion is somewhat orthogonal.



More information about the Digitalmars-d mailing list