User Defined Attributes

Max Samukha maxsamukha at gmail.com
Tue Nov 6 12:28:41 PST 2012


On Tuesday, 6 November 2012 at 20:14:56 UTC, Walter Bright wrote:
> On 11/6/2012 11:42 AM, Max Samukha wrote:> Theoretically there 
> might be cases requiring an attribute of the same class both
> > on the function and on the return value. Then differentiation
> of function and
> > return value attributes would be necessary. Anybody has an
> example?
>
> Not a problem, as you'd search the tuple for the attribute that 
> matters anyway.

By "the same class" I meant:

template SomeFunkyID(string id)
{
}

[SomeFunkyID!"boo"]
[return: SomeFunkyID!"bar"]
void foo();

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?



More information about the Digitalmars-d-announce mailing list