template parameters

Ellery Newcomer ellery-newcomer at utulsa.edu
Fri Sep 25 14:21:06 PDT 2009


BCS wrote:
> Hello Ellery,
> 
>> Hello.
>>
>> Today I was looking at the grammar for template value parameters and
>> realized I didn't know what the conditional expression is for in
>>
>> TemplateValueParameter => BasicType Declarator : ConditionalExpression
>>
>> So what does it do?
>>
>> (I assume = ConditionalExpression is the default value for the
>> parameter)
>>
> 
> That is correct. it would seem that expression should be used, but that
> includes an assignment expression so the next things down is used.
> 
> http://www.digitalmars.com/d/1.0/expression.html#AssignExpression
> 
> 

Okay, let me rephrase that:

When you have a <something> preceded by a colon in a template value
parameter, what are its semantics? Is it the same as a default parameter
value? Is it some sort of constraining expression? Is it a vestige?


More information about the Digitalmars-d-learn mailing list