Quantcast
Channel: Deadbeef.COM » c#
Viewing all articles
Browse latest Browse all 12

Boost::regex tip of the day

$
0
0

If you use boost::regex, don’t do what I just did.

  1. Calling boost::regex_match(std::string&,match_results&,basic_regex&)
  2. Changing the std::string that was passed to regex_match.
  3. Trying to look at the sub-matches in the match_results object.

I didn’t realize that match_results kept references to the string, and so you can’t edit the string.

Perhaps that will save someone from hitting an assert().


Viewing all articles
Browse latest Browse all 12

Trending Articles