lst-0827-book.cpp
// https://godbolt.org/z/WqvM6KEEM
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <string_view>
using std::string_view; using namespace std::literals; using std::cout;
auto istPalindrom(string_view sv) {
return std::ranges::equal(sv.begin(), sv.end(), sv.rbegin(), sv.rend()); };
int main() {
for(auto s : {"regallager"sv, "rentner"sv, "blutwurst"sv }) {
cout << s << " ist " << (istPalindrom(s)?"ein":"kein") << " Palindrom\n";
}
}