Compile-Time std::map

NN nn-mail at bk.ru
Sat Apr 28 07:10:51 PDT 2007


Ok, from the beginning :)
While writing I think all problems are solved, but I'm not sure.

I want to do binary search on any array:

int[] sorted_array = {1,2,3};
binary_search(sorted_array, 1); // complexity O(log N)

But i can do it only if array is sorted.
I want to write any array and sort it in compile time:

int[] sorted_array = compile_time_sort({3,2,1});

Is it possible ?



More information about the Digitalmars-d mailing list