Hi all,
I have a fairly straight forward problem, but so far I've only come up with solutions that are pretty cumbersome (lots of it statements and redundant code), so I was wondering if someone has a good approach to do this.
- I have std::vectors with unsigned ints
- depending on the use-case, 1, 2, 3 or 4 of the vectors are needed (form of filtering)
- I need to figure out which numbers occur in all of the 1, 2, 3 or 4 vectors, depending on the filter selection in my tool
There must be a better way then doing a lot of if statements to check which vectors to use and then loop through them. For ease of use I could also have the 4 vectors be an array of vectors (e.g. std::vector<uint> myNumberVectors[4]
Any input is appreciated.