Do pure functions solve the "return const" problems?

Janice Caron caron800 at googlemail.com
Wed Apr 9 23:29:14 PDT 2008


On 10/04/2008, Christopher Wright <dhasenan at gmail.com> wrote:
>  But you seem to be saying that, if you remove 'pure' from all those
> functions, the result will be undefined. Is this the case?

The order of evaluation is undefined. The result depends on the order
of evaluation. In fact, according to the D docs, it's even possible
for the same function to give different results depending on whether
it's evaluated at compile-time or run-time, if you rely on "dependency
on implementation defined order of evaluation".



More information about the Digitalmars-d mailing list