User Defined Attributes

Max Samukha maxsamukha at gmail.com
Tue Nov 6 13:40:48 PST 2012


On Tuesday, 6 November 2012 at 20:49:07 UTC, Walter Bright wrote:
> On 11/6/2012 12:28 PM, Max Samukha wrote:
>> In C#, I can distinguish, which of SomeFunkyID instances is 
>> intended for the
>> return value and which for the function itself. How would I do 
>> that if both
>> attributes were piled together in the same tuple?
>
> Make SomeFunkyID a parameter to a ReturnOnly template that 
> you've defined.

Right. However, the discussion is about adding real attributes to 
parameters. We all agree that they are not strictly necessary:

[ParameterAttributes!(SomeFunkyID!...)]
void foo(int x);

But that is what people are complaining about because it is 
inconsistent with other declarations. In other words, if you are 
going to implement parameter attributes, either go all the way or 
don't do that at all.




More information about the Digitalmars-d-announce mailing list