Question: Lets say i have a named range in excel. It has links to recipes in column A. Adjacent columns have some more information on the recipe. 

For instance column B has 'Ingredients', column C has 'Kitchen utensils needed', column D has 'Course'. 

In all cells of columns B and further there may be multiple entries, in random order, separated by comma's. E.g. for apple pie the ingredients would be 'Apple, butter, egg, sugar'. Kitchen utensils could 'oven, pie-container, mixing-machine' 

I made some multiple select listboxes in which all possible ingredients are listed, all possible utensils are listed, etc. I want to use the listboxes to filter out the appropriate recipes.

Now the autofilter can only filter up to two words at the same time for one specific column. I want to be able to look up any amounts of ingredients at the same time. All recipes having any of the selected ingredients must show up, even if i select 10 ingredients. 

There is also the advanced filter, however because i have multiple columns (10 for the actual data which is not recipes) and want to be able to select up to 10 (more or less) search values per column, the amount of combinations that i need to supply for the advanced filter quickly grows out of control. 

Any thoughts on how to achieve this in VBA?

So all rows where Column A contains (x or y or z or ...) AND Column B contains (f or g or h or ...) AND column C contains (q or p or r or ...), etc.

It's quite easily written down in one sentence here, but I'm a bit lost at making the translation to VBA code for the filtering. I do have the selected values of the listboxes in a dict.

Answer: 
It should be:

```
outages.erase(std::remove_if(outages.begin, outages.end(), isNotOutageValid), outages.end());

```

Currently, you partition outages not valid first, valid last (in other words, your predicate is inverted).  

And then remove the fist valid element (instead of a range).
1.You forgot to specify the second argument of `erase`, which is the end of the range which is erased:

```
outages.erase(std::remove_if(outages.begin, outages.end(), isOutageValid), outages.end());

```

2.The condition is invalid, you should negate it:

```
 #include <functional>

 outages.erase(std::remove_if(outages.begin, outages.end(), std::not1(std::ptr_fun(&isOutageValid))), outages.end());

```