All,
I am trying to copy from a boost::cmatch variable to a std::set. It
compiles fine but when I run it I get a:
Debug Assertion Failure
xtree 245
map/set iterator not dereferencable
I think it's the "match.begin()" and "match.end()" in std::copy that is
failing. This is a short version of what I have:
#include
#include <algorithm>
#include <string>
#include <set>
bool Parse( const std::string &page, std::set< std::string > &links )
{
const boost::regex expression( "123" );
boost::cmatch match;
if( boost::regex_search( page.c_str(), match, expression ) )
{
std::copy( match.begin(), match.end(), links.begin() );
return true;
}
return false;
}
int main()
{
std::string test_data = "www.abc123.com/index.php";
std::set< std::string > links;
Parse( test_data, links );
return EXIT_SUCCESS;
}
Thanks in advance.
Carl.