Skip to content
Snippets Groups Projects
Commit 24f86a02 authored by pierre-luc's avatar pierre-luc
Browse files

[#1744] Fix inconsistency in the finditer method from the last commit.

parent dacf7f83
Branches
Tags
No related merge requests found
......@@ -125,11 +125,12 @@ namespace sfl {
return _outputVector;
}
std::vector<std::string>::iterator Regex::finditer(const std::string& subject)
range Regex::finditer(const std::string& subject)
{
findall(subject);
std::vector<std::string>::iterator iter = _outputVector.begin();
return iter;
std::vector<std::string>::iterator iterBegin = _outputVector.begin();
std::vector<std::string>::iterator iterEnd = _outputVector.end();
return range(iterBegin, iterEnd);
}
}
......@@ -25,6 +25,18 @@
namespace sfl {
/**
* While waiting for C++0x to come out
* Let's say that we have something like
* std::range
*
* Defines a pair of iterator over a vector of
* strings. The fist element corresponds to the
* begining of the vector, while the second is
* set to the end.
*/
typedef std::pair<std::vector<std::string>::iterator, std::vector<std::string>::iterator> range;
/**
* Exception object that is throw when
* an error occured while compiling the
......@@ -99,7 +111,7 @@ namespace sfl {
* containing the substrings that
* were matched.
*/
std::vector<std::string>::iterator finditer(const std::string& subject);
range finditer(const std::string& subject);
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment