Hi there,

I am using STL and have to deal with many lists (map, vector, etc) which are VERY long. I need to appy filters to a list in some orders and remove them in the reverse order. A filter may allow a certain number of elements to be visible. But there is also a type of filter which disallow a list of elements. Whenever a filter is applied, I need to visit all visible elements many times and dynamically decide what kind of filter comes next.

My problem is that it is so slow to do such operations if it is done very often and the list is simply too long. Each filter has to change different flags in the elements. The combination of flags determine wheter the element is visible. Current implementation is to go through all elements each time a filter is applied/removed. Of course, is not elegant at all.

Therefore, I'd like to ask you guys if you have a better desing for this problem.