Esempio n. 1
0
BasicVec<int> find_with_index(Sc2String name, BasicVec<Sc2String> list){
    BasicVec<int> res; res.reserve(list.size());
    for(unsigned i=0;i<list.size();i++){
        if(name==list[i]){res.push_back(i);}
    }
    return res;
}
Esempio n. 2
0
template<class VB> BasicVec<unsigned> find_with_index(const VB &to_check) {
    BasicVec<unsigned> res; res.reserve( to_check.size() );
    for(unsigned i=0;i<to_check.size();++i)
        if ( to_check[i] )
            res.push_back( i );
    return res;
}