assumeSafeAppend and purity

Vladimir Panteleev vladimir at
Mon Feb 6 18:32:05 PST 2012

On Tuesday, 7 February 2012 at 01:47:12 UTC, Jonathan M Davis 
> At present, assumeSafeAppend isn't pure - nor is capacity or 
> reserve. AFAIK, none of them access any global variables aside 
> from GC-related stuff (and new is already allowed in pure 
> functions). All it would take to make them pure is to mark the 
> declarations for the C functions that they call pure (and those 
> functions aren't part of the public API) and then mark them as 
> pure. Is there any reason why this would be a _bad_ idea?

If precedent means anything, assumeUnique is pure.

More information about the Digitalmars-d mailing list