Xinok Sort - December 2011

Xinok xinok at live.com
Wed Nov 30 17:23:29 PST 2011


I've released a few updates for my sorting algorithm in the past month.

https://sourceforge.net/projects/xinoksort/

Major changes:
* Added concurrency using taskPool
* Use any callable type as predicate (functions, delegates)
* Unittests
* Documentation
* Minor optimizations


I have a few more things I'd like to address before I do a pull request:

* Should I use the global 'taskPool', or a unique TaskPool object for 
concurrency?

* Is it possible to overload opDollar / __dollar at the moment? 
Otherwise, I'll replace the dollars with *.length instead.

* I can't figure out all the requirements to satisfy the condition, 
isRandomAccessRange!(). I've read through the documentation a few times 
but I'm still missing something. I've successfully tested the code for 
ranges on arrays, but not any class type.

class N(T){
	T[] arr;
	this(T[] other){ arr = other.save; }
	ref T opIndex(size_t i){ return arr[i]; }
	size_t length(){ return arr.length; }
	ref T front(){ return arr.front; }
	ref T back(){ return arr.back; }
	ref T popFront(){ arr.popFront(); }
	ref T popBack(){ arr.popBack(); }
	bool empty(){ return arr.empty; }
	N save(){ return new N(arr); }
}
static assert(isRandomAccessRange!(N!uint));


More information about the Digitalmars-d-announce mailing list