More flexible sorted ranges?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Nov 2 08:23:10 PST 2014


On Sunday, 2 November 2014 at 15:13:37 UTC, bearophile wrote:
> This means having an array of Foos as sorted range, and 
> appending an item to it keeping the sorting invariant (so in 
> non-release mode the append verifies the array is empty or the 
> last two items satisfy the sorting invariant), and this allows 
> me to call functions like upperBound any time I want on 'data' 
> without using any unsafe and unclean assumeSorted.

Shouldn't sorted range maintain the invariant automatically in 
order to remain typesafe?



More information about the Digitalmars-d-learn mailing list