
4 Jan
2011
4 Jan
'11
8:56 p.m.
Howard Hinnant wrote:
Warming this up for tr2:
http://home.roadrunner.com/~hinnant/combinations.html
Comments welcome. Real world use welcome.
Hi Howard, The only time I've needed to use anything like this was for some sort of search, with termination as soon as a solution is found. With these algorithms it looks like you'd need to throw an exception to do this, which is rather frowned-upon, no? I wonder if the functor could return a bool, or something. Re the improved performance compared to next_permutation, I always think of co-routines when I see things like this. A co-routine could be used to wrap your faster algorithm in the interface of next_permutation. Yet co-routines are rarely used. I wonder why? Regards, Phil.