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: bruno@… 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:

http://stackoverflow.com/questions/13301062/

Change History (1)

comment:1 by Neil Groves, 9 years ago

Resolution: invalid
Status: newclosed

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.

Note: See TracTickets for help on using tickets.