Compile-Time std::map

NN nn-mail at bk.ru
Fri Apr 27 14:26:09 PDT 2007


I allways wanted to create std::map but in compile time.

The problem:
I want to write smth like:
int[int] x = {3:3,2:2,1:1}

But compiler will generate the following:
int[int] x = {1:1,2:2,3:3}

Thus I can use binary search on x.

Is it possible to do in D ?
Thanx.



More information about the Digitalmars-d mailing list