Proposal for SentinelInputRange
Ary Borenszweig
ary at esperanto.org.ar
Thu Feb 28 06:48:59 PST 2013
On 2/28/13 1:57 AM, Walter Bright wrote:
> On 2/27/2013 8:01 PM, John Colvin wrote:
>> Why must sentinel be known at compile time? I don't see what's in the
>> way of it
>> being a runtime argument.
>
> Performance!
>
> It should be usable as a case in a switch statement.
Isn't it possible for the optimizer to inline the function call and then
combine the next ifs?
if (isSentinel(value)) {
} else {
switch(value) {
case ...
}
}
More information about the Digitalmars-d
mailing list