Blender Git Commit Log

Git Commits -> Revision ff2db09

June 21, 2021, 18:09 (GMT)
bli: generational_arena: add iterator support

Made as a bidirectional iterator since movement can be in both
directions. Random access iterator is not possible since there can be
gaps in between the elements.

Had a very annoying bug- using the iterator with the standard library
would throw an error "`iterator_category` not defined" even though it
was defined. Spent a lot of time to realize that `difference_type`
should also be defined but other types within the iterator class are
optional. For some reason the compiler does not create the
`iterator_trait` correctly if `difference_type` is missing but throws
error about `iterator_category` which is extremely strange and time consuming to debug :(

Commit Details:

Full Hash: ff2db09f55245077647ff953f7d63ccb40544b2c
Parent Commit: 476610d
Lines Changed: +197, -0

2 Modified Paths:

/source/blender/blenlib/BLI_generational_arena.hh (+113, -0) (Diff)
/source/blender/blenlib/tests/BLI_generational_arena_test.cc (+84, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021