D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18333 - binaryHeap documentation inadequately describes slice store invalidation
Summary: binaryHeap documentation inadequately describes slice store invalidation
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: bootcamp
Depends on:
Blocks:
 
Reported: 2018-01-30 07:43 UTC by Simen Kjaeraas
Modified: 2023-02-09 12:55 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Simen Kjaeraas 2018-01-30 07:43:06 UTC
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.
Comment 1 Dlang Bot 2023-02-03 19:53:16 UTC
@MathewColin created dlang/phobos pull request #8677 "Better document the use of Heaps with Dynamic Array as Store" mentioning this issue:

-     Better document the use of Heaps with Dynamic Array as Store
  
      Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation

https://github.com/dlang/phobos/pull/8677
Comment 2 Dlang Bot 2023-02-09 12:55:53 UTC
dlang/phobos pull request #8677 "Better document the use of Heaps with Dynamic Array as Store" was merged into master:

- bd8bdb2dee980c2713be0580d592da29f1341a7a by Matei Calin Ceausu:
      Better document the use of Heaps with Dynamic Array as Store
  
      Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation

- d1b7eebf65b7267580378209082b8d3e18120fc7 by Matei Calin Ceausu:
  Better document the use of Heaps with Dynamic Array as Store
  
  Fix issue 18333: binaryHeap documentation inadequately describes slice store invalidation

https://github.com/dlang/phobos/pull/8677