
On Nov 18, 2004, at 9:38 AM, David Abrahams wrote:
Daniel Wallin <dalwan01@student.umu.se> writes: One possible alternative is
params.defaults_to("unnamed")[name]
but I find that highly illogical to read, because the specification of the default precedes the keyword it's defaulting.
However, Thorsten's prodding has made me wonder if we need || for the lazy case at all. It seems as though
params.has(name) ? params[name] : something_else;
is superior in every way except brevity. And there will be substantial cases where it's briefer as well, because there's no need to build a function object for something_else.
Am I missing something?
"something_else" still has to compile, whereas with "|| something_lazy", "something_lazy()" does not have to compile. Doug