The two C++23 range algorithms, std::ranges::starts_with and std::ranges::ends_with, implement prefix and suffix checks for ranges.
std::ranges::starts_with can operate on any range, std::ranges::ends_with requires at least a forward range.
Click to open in Compiler Explorer.
Leave a comment