Marc Schütz:

class buffer(T, size_t sz) {
        auto arr = new T[sz];

This allocates an array with `sz` elements once _at compile time_, places it somewhere into the executable, and uses its address as the default initializer for the member `arr`.

Right. It's not a compiler bug. Dmd/ldc are working correctly.

Bye,
bearophile

Reply via email to