Le 2011-04-21 à 17:54, Robert Jacques a écrit :

> First, remember that basic assignments can be chained: x = y = 1; So a 
> property should never return void, whether it's a setter or a getter 
> logically.

Indeed. You'd expect the property to return the value you set to it.


> Second, there are situations where you want to be able to support:
> 
> a.prop1 =  5;
> 
> and
> 
> auto b = a.prop1(5).prop2(6);

But here you have a dilemma. To work like "x = y = 1" above, "a.prop1 = 5" 
should return "5". But to work with chaining, "a.prop1(5)" should return "a". 
How do you make that work?


-- 
Michel Fortin
[email protected]
http://michelf.com/



_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to