October 02, 2015
On Thursday, 1 October 2015 at 22:37:57 UTC, Ali Çehreli wrote:
> template allSame(V...)
>     if (isExpressions!(V))
> {
>     bool impl_(V...)() {
>         static if (V.length > 1) {
>             foreach (i, _; V[0 .. $ - 1]) {
>                 if (V[i] != V[i + 1]) {
>                     return false;
>                 }
>             }
>
>             return true;
>
>         } else {
>             return true;
>         }
>     }
>
>     enum allSame = impl_!V();
> }

Will proposed `static foreach` reduce number of instantiations here?
October 02, 2015
On Friday, 2 October 2015 at 07:52:22 UTC, Nordlöw wrote:
> On Friday, 2 October 2015 at 02:39:56 UTC, Meta wrote:
>> Highly doubtful as CTFE already allocates like there's no tomorrow.
>
> Could that memory usage be tested somehow?

Your favourite process monitor I guess.
October 02, 2015
On Friday, 2 October 2015 at 16:21:22 UTC, Meta wrote:
>> Could that memory usage be tested somehow?
>
> Your favourite process monitor I guess.

Any suggestions on an evil D snippet that stress tests different implementations of the above mentioned traits?
October 02, 2015
On Friday, 2 October 2015 at 18:52:22 UTC, Nordlöw wrote:
> On Friday, 2 October 2015 at 16:21:22 UTC, Meta wrote:
>>> Could that memory usage be tested somehow?
>>
>> Your favourite process monitor I guess.
>
> Any suggestions on an evil D snippet that stress tests different implementations of the above mentioned traits?

I don't know off the top of my head, but I remember somebody on these forums mentioning a certain CTFE program that caused DMD to take up over 100GB in RAM before the process was killed.
1 2
Next ›   Last »