Why function template 'among' is of complexity O(1) and not O(n)?

Chris Williams yoreanon-chrisw at yahoo.co.jp
Wed Feb 19 18:19:58 PST 2014


On Thursday, 20 February 2014 at 02:10:50 UTC, anonymous wrote:
> The foreach is definitely always evaluated at compile time.
> That's independent of the values being known statically. It
> generates a couple of if statements. But optimizing those if
> statements away for static values is not guaranteed or expected.

Ah, roger.


More information about the Digitalmars-d-learn mailing list