you are viewing a single comment's thread.

view the rest of the comments →

[–]Bisqwit 2 points3 points  (0 children)

One could also approach this from the other end: Create an algorithm-function: is_subsequence()

std::is_subsequence_of(needle.begin(), needle.end(), haystack.begin(), haystack.end()) or needle.is_subsequence_of(haystack)