Proposal: Relax rules for 'pure'

Tomek Sowiński just at ask.me
Thu Sep 23 16:36:43 PDT 2010


Tomek Sowiński napisał:

> So in the "three levels of purity" nomenclature, tail(const|immutable)
> would popularize the stronger two. E.g. popFront() could be immutably pure
> if the range in on an immutable collection and const-pure if it's on any
> collection.

Ehm, sorry.. popFront() is a bad example because 'this' is a reference. Tail const still would 
popularize the stronger pure, only it doesn't really buy you much. You can rebind argument 
pointers inside a strong-pure function, that's all.

(must stop posting at 1 a.m.)

-- 
Tomek


More information about the Digitalmars-d mailing list