@property with 2 arguments

Tony tonytdominguez at aol.com
Sun Oct 1 08:40:35 UTC 2017


On Sunday, 1 October 2017 at 07:11:14 UTC, bitwise wrote:
> On Sunday, 1 October 2017 at 05:57:53 UTC, Tony wrote:
>> "@property functions can only have zero, one or two parameters"
>>
>> I am looking for an example of an @property function defined 
>> with two parameters and the syntax for how it is accessed 
>> without ().
>
> And also this, which probably shouldn't actually work:
>
> struct S {
>     @property void prop(int a, int b){}
> }
>
> int main(string[] argv)
> {
>     S s;
>     s.prop = AliasSeq!(1, 2);
>     return 0;
> }

Thanks! I was thinking it was something that looked like that, 
although the limitation to two items was puzzling.


More information about the Digitalmars-d-learn mailing list