Skip to main content
9 events
when toggle format what by license comment
Jul 19, 2017 at 3:46 vote accept Eango
Jul 19, 2017 at 3:46
Jul 17, 2017 at 20:11 comment added miscco Yeah, it turns out one just has to read the manual .. std::mismatch returns a pair of iterators so you can simply start from the result again
Jul 17, 2017 at 20:11 history edited miscco CC BY-SA 3.0
Added second version following Deduplicators suggestions
Jul 17, 2017 at 19:38 comment added Deduplicator Not really, mismatch from start, mismatch from end using reverse-iterators, examine the part between. See my post.
Jul 17, 2017 at 19:27 comment added miscco I thought about using std::missmatch, however the problem is, that you want to increment both iterators, which most std algorithms simply dont do. In that case you would have to work with stuff like std::next(s1.begin(), std::distance(s2.begin(), missmatch)) which is not really better
Jul 17, 2017 at 16:29 history edited Toby Speight CC BY-SA 3.0
Spelling fixes
Jul 17, 2017 at 14:12 comment added Deduplicator That can be written nicer even restricted to C++11.
Jul 17, 2017 at 12:50 history edited miscco CC BY-SA 3.0
Fix error if the first missmatch is the last character in s2 and wrong increment, add final return and fix typo
Jul 17, 2017 at 12:40 history answered miscco CC BY-SA 3.0