relink() usage incorrect in section "Implementing a Cache of Limited Size" of documentation
Bug #628974 reported by
freshcoast
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MCT |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In this section, the docs state:
If the cache is a linked_hash_map, you can use relink() to alter iteration order. For instance, adding:
cache.relink (entry, cache.end ());
However, the two parameters are reversed. Also, entry is declared as a const_iterator, but if used with relink it must not be const.
Related branches
Changed in libmct: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Thank you. Swapped args in the code snippet and changed const_iterator to iterator — hardly matters that modifiability is not needed if you don't relink.