Re: [sv-ec] Mantis 1857 - extern method types for parameterized classes

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Wed Jun 20 2007 - 11:28:33 PDT
Mark Hartoog wrote:
>> From: Gordon Vreugdenhil [mailto:gordonv@model.com] 
>> Sent: Wednesday, June 20, 2007 9:44 AM
 >>
>> The second is exactly the situation I posted originally -- 
>> when you parse C::T you don't know if you are referring to 
>> "T" in the default specialization of C or whether you are 
>> referring to the unspecialized name "T" in the parameterized 
>> class for an extern method definition.
>>
>> And, as I also posted previously, you could require C#()::T 
>> in such situations but that would be irregular with the 
>> semantics of a reference to "C" in other type contexts.
>>
> 
> I agree that this is a somewhat irregular, but all the proposals
> are somewhat irregular.
> 
> In another context C::T would refer to the default value of T in 
> class C, but C::get() in another context would be a static function 
> call to the get() function in class C with default parameter values. 
> We have no problem understanding that in the context of a function 
> declaration C::get() means something different.

Of course - but C::get() when preceded by the keyword "function"
is clearly and unambiguously the name of the function definition.
If we ever allow type-specific method specializations in the C++ sense,
this syntax would also become ambiguous.

In the context of the return type, the return type is a type
reference and since C::T is clearly a type reference meaning
the type of the default in other circumstances, I view these
as being of a fundamentally different nature.


> If we want some special syntax rather than 'C::T' I would be ok with
> that, but I don't like 'C#()::T'. The C#() looks even more like C with
> default parameter values. Maybe 'C#::T' would be better.   

The special syntax of C#()::T would NOT mean the unspecialized
name.  We already explicitly introduced C#() to allow a
non-implicit reference to the default specialization and I
would object even more vehemently to that changing meaning.

What I meant to say was that if we required C#()::T to be
used in all function return types EXCEPT when we were defining
an extern method of a parameterized class then we could
have C::T denote the unspecialized type.  But that is
irregular enough that it will be very surprising to people
that already use C::T forms of type referencing.

Gord.
-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jun 20 11:28:52 2007

This archive was generated by hypermail 2.1.8 : Wed Jun 20 2007 - 11:29:03 PDT