Discussion Thread: DIP 1044--Enum Type Inference--Community Review Round 1

Stefan Koch uplink.coder at googlemail.com
Thu Nov 24 10:48:22 UTC 2022


On Thursday, 24 November 2022 at 10:33:04 UTC, Stefan Koch wrote:

> Strictly speaking the worst case combinatorics for overloaded 
> `$` expressions is O(n * m) where n is the number of overloads, 
> m is the number of distinct enum parameters in the same 
> position.

Oops I used the words strictly speaking, that was wrong.
Because the hash-table lookup could degenerate into a linear 
search.

strictly speaking: it's O(n * m * k) where
   n is the number of overloads
   m is the sum of enum parameters in n
   k is sum of the number of enum members in the set of distinct 
enum types used by all overloads.
But that's _highly_ unlikely.

So, _generally_ speaking it's O(n * m).
_strictly_ speaking it's O (n * m * k).






More information about the Digitalmars-d mailing list