On a low level, I want something like this code to work:
    string[] arr;      // this can be any suitable type

    arr ~= "a";        // data is compile-time constant

enum f = arr[0]; // fails with "Error: variable arr cannot be read at compile time" enum b = arr[$-1]; // fails with "Error: variable arr cannot be read at compile time"

More generic description: I'm looking for a way to have a container (or any other type) that I can manipulate during compile time. Operations needed are similar to stack functionality: get first/last element, push_back and pop_back.

How can I do that?

Reply via email to