Complexity nomenclature

Dmitry Olshansky via Digitalmars-d digitalmars-d at puremagic.com
Fri Dec 4 10:49:46 PST 2015


On 04-Dec-2015 19:06, Andrei Alexandrescu wrote:
> On 12/04/2015 01:05 AM, Tofu Ninja wrote:
>> Also maybe a simpler idea would just be to annotate the the operations
>> with there complexity with UDAs. That way things that really care about
>> the complexity can get it, and those who don't can ignore it. It has the
>> benefit of being self documenting as well.
>
> Well look at what the cat dragged in:
>
> http://dpaste.dzfl.pl/711aecacc450

Was vaguely terrified reading this whole thread until hitting this gem. 
Seems like a creative use for UDA.

>
> That's quite promising. The code is very preliminary and uses strings
> for typical complexity values (e.g. "constant", "linear", and later
> "loglinear" etc). I need to see how to integrate this whole idea.
>
> Also an unpleasant problem is overloading - when present, user code
> needs to specify which overload they're referring to.
>
> Anyhow, this is really interesting. Thanks Tofu.
>
>
> Andrei
>


-- 
Dmitry Olshansky


More information about the Digitalmars-d mailing list