26 Feb
2008
26 Feb
'08
3:49 p.m.
ALSA_HPP_CLASS& set_##name(...) { ...; return *this; }\
Is there a reason why you return the object itself? Usually, returning an object implies that that object is a _different_ object with the setting applied, which would mean that the original object was _not_ changed, but that isn't true here.
I'm not an OO design guru, but at least IOC (IBM OpenClass; it used to be a rather powerful multiplatform GUI framework - before they made it AIX only) used this very paradigma all over the place.
You were supposed to write statements like: obj.method1().method2().method3().___.method_n();
At least that's what all their example code looked like.
Best, Michael
--
Michael Gerdau email: mgerdau@tiscali.de
GPG-keys available on request or at public keyserver