www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18333] New: binaryHeap documentation inadequately describes


          Issue ID: 18333
           Summary: binaryHeap documentation inadequately describes slice
                    store invalidation
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: simen.kjaras gmail.com

All the examples on https://dlang.org/phobos/std_container_binaryheap.html use
heaps initialized from slices. Slice semantics are unintuitive since the slice
is at first updated to reflect the data structure of the heap, but at some
arbitrary point in the future the connection may be broken, when the binaryHeap
causes a reallocation.

There should be examples pointing out this unintuitive behavior, and explaining
alternate stores and their benefits.

Jan 29 2018