[Issue 5348] Variable Length Arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 15 14:45:55 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5348



--- Comment #5 from bearophile_hugs at eml.cc 2011-11-15 14:45:02 PST ---
Currently this works, and ct_function() is run at compile-time because fixed
array length definitions is a compile-time context, so in D it forces CTFE:


int ct_function(int x) {
    return x * 2;
}
void main() {
    int[ct_function(5)] a;
}


If VLA come in D, and if their definition syntax is the same as the current
fixed array definition syntax, then that length definition stops being a
compile-time context, and the compiler is not forced (but free any way) to run
ct_function() at compile-time.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list