I came to this somewhat picturesque solution: #include <string> bool is_palindromic(const std::string& s) { std::string::const_iterator start = s.begin(); std::string::const_iterator end = s.end(); while (start < end) { if (*(start++) != *(--end)) { return false; } } return true; } ...that copes with emptiness and automatically treats it as palindromic.