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; }
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; }
void aaadd( BasicVec<String> var_templ, BasicVec<BasicVec<String,2> > rep ) { if ( var_templ.size() ) { BasicVec<String> t = tokenize( var_templ.back(), ' ' ); var_templ.pop_back(); for( int i = 1; i < t.size(); ++i ) { rep.push_back( t[ 0 ], t[ i ] ); aaadd( var_templ, rep ); rep.pop_back(); } } else res << rep; }