]> git.tdb.fi Git - libs/core.git/blobdiff - source/strings/regmatch.cpp
Use C++11 features with containers
[libs/core.git] / source / strings / regmatch.cpp
index 4799cfbd4e536b1634ba48b5d5bf625e8da06eb6..0e702b5e9568c5a3e5a2dd9a3fc6b49dce1d402a 100644 (file)
@@ -5,14 +5,14 @@ using namespace std;
 
 namespace Msp {
 
-RegMatch::RegMatch(const string &str, const GroupArray &g):
-       groups(g)
+RegMatch::RegMatch(const string &str, const vector<Group> &grps):
+       groups(grps)
 {
-       for(GroupArray::iterator i=groups.begin(); i!=groups.end(); ++i)
-               if(i->match)
+       for(Group &g: groups)
+               if(g.match)
                {
-                       i->length = i->end-i->begin;
-                       i->str = str.substr(i->begin, i->length);
+                       g.length = g.end-g.begin;
+                       g.str = str.substr(g.begin, g.length);
                }
 }