I am trying to use use std::set_intersection to find common elements between 2 completely different types of data structures that have a common binding \'na
set_intersection isn't magic, if you have sorted vectors it is very easy to roll your own, roughly like this:
auto ta = aStructs.begin();
auto tb = bStructs.begin();
while( ta != aStructs.end() && tb != bStructs.end() ){
if( ta->mCommonField < tb->mCommonField ){
++ta;
} else if( tb->mCommonField < ta->mCommonField ){
++tb;
} else {
std::cout << "found common: " << ta->mCommonField << std::endl;
++ta;
++tb;
}
}