This seems useful. However, the motivation seems not to be strong enough, because
- Although some other languages may have such functionality, I think C++ should not copy everything without a deep thinking and clear motivation.
- Even it could simplify the “find != npos” pattern, I do not find this pattern widely existing in engineering.
- If we take one step backward, even if it is a useful pattern, we may turn to regex for more readability and extendibility rather than “find != npos”.
- The name has already been used in other facilities like “set” or “map” with completely different semantics, which may confuse the beginners and decrease “teachability”.
Therefore, I would suggest investigating more on the motivation. For the fourth comment above, I think “includes” could be a better name than “contains”.
Regards,
Mingxin Wang