Do pure functions solve the "return const" problems?

Bruno Medeiros brunodomedeiros+spam at com.gmail
Tue Apr 29 05:21:14 PDT 2008


Christopher Wright wrote:
> 
> Right. But since you can trivially rewrite every function with out 
> parameters as one that has multiple return values, it's reasonable to 
> expect a compiler to fully support pure functions with out parameters.
> 

   void func(out int a, out int b) {
     a = 2;
     b = 10;
   }

How do you rewrite this function with multiple return values? (You 
can't, because of the case where there is aliasing of the arguments, 
which wouldn't have the same result if the function was rewritten with 
multiple return values)

-- 
Bruno Medeiros - Software Developer, MSc. in CS/E graduate
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list