Opened 10 years ago
Closed 9 years ago
#7667 closed Bugs (invalid)
boost::adaptors::transformed followed by boost::adaptors::filtered calls function twice
Reported by: | Owned by: | Neil Groves | |
---|---|---|---|
Milestone: | To Be Determined | Component: | range |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
When boost::adaptors::transformed is followed by a boost::adaptors::filtered, transformed's function is called twice for each output where filtered's predicate is true. For sample code, please check:
Note:
See TracTickets
for help on using tickets.
The function is called upon dereference. This is by design. If often provides optimal performance. When it does not there are many more cases of expensive repetitive dereference than just this, hence a general caching solution is more capable and more broadly applicable.