dcollections 1.0 and 2.0a beta released

Simen kjaeraas simen.kjaras at gmail.com
Sat May 22 05:34:45 PDT 2010


BCS <none at anon.com> wrote:

> Cool. Now how do I write code so that it will always iterate the  
> collection with the bigger O() lookup time (O(n) before O(log2(n))  
> before O(log16(n)) before O(1))? :D

Add a function.

auto foo( R1, R2 )( R1 r1, R2 r2 ) if ( R1.complexity( 10_000 ) >  
R2.complexity( 10_000 ) ) {
	...
}

auto foo( R1, R2 )( R2 r1, R1 r2 ) if ( R1.complexity( 10_000 ) <  
R2.complexity( 10_000 ) ) {
	...
}

-- 
Simen


More information about the Digitalmars-d-announce mailing list