Do pure functions solve the "return const" problems?

Janice Caron caron800 at googlemail.com
Sat Apr 5 07:42:25 PDT 2008


On 05/04/2008, Christopher Wright <dhasenan at gmail.com> wrote:
>  That might be an argument for removing out parameters -- it looks like f(x)
> + f(x) is the same as 2 * f(x). The compiler could tell the difference, so
> there's no problem on that side. It could basically rewrite the pretty f(x)
> + f(x) as the mess you recommended.

I'm afraid it can't because + isn't defined for Tuple!(int,int). Even
if the compiler could deduce what the declaration of g would have to
be, it still couldn't write the body.



More information about the Digitalmars-d mailing list