Getting the const-correctness of Object sorted once and for all

Alex Rønne Petersen xtzgzorex at gmail.com
Sun May 13 10:53:47 PDT 2012


On 13-05-2012 19:27, Stewart Gordon wrote:
> On 13/05/2012 18:04, Alex Rønne Petersen wrote:
> <snip>
>> But how would you memoize the value in the instance of the object if
>> it's const?
>
> By storing the memoized value outside of the object. Read the code of
> std.functional.memoize - you'll see that it holds the values in a static
> AA.
>
> Stewart.

Which forces you to:

1) use an AA lookup
2) use the GC

Not an optimal solution IMHO.

-- 
- Alex


More information about the Digitalmars-d mailing list