Public Types | |
|
typedef std::basic_string < Char, Traits > | string |
| Convenience typedef. | |
Public Member Functions | |
| palindrome_tester (std::locale &locale) | |
| bool | isalpha (Char c) const |
| Char | lowercase (Char c) const |
| bool | operator() (string const &str) const |
Definition at line 16 of file palindrome.cpp.
| palindrome_tester< Char, Traits >::palindrome_tester | ( | std::locale & | locale | ) | [inline] |
Construct the palindrome tester for the given locale. Cache the locale to use for testing characters.
| locale | The locale to use for interpreting characters |
Definition at line 26 of file palindrome.cpp.
| bool palindrome_tester< Char, Traits >::isalpha | ( | Char | c | ) | const [inline] |
Test for non-letter.
| c | the character to test |
ch is not a letter Definition at line 35 of file palindrome.cpp.
Referenced by palindrome_tester< Char, Traits >::operator()().
| Char palindrome_tester< Char, Traits >::lowercase | ( | Char | c | ) | const [inline] |
Convert to lowercase. Use a canonical form by converting to uppercase first, and then to lowercase.
| c | the character to convert |
Definition at line 43 of file palindrome.cpp.
Referenced by palindrome_tester< Char, Traits >::operator()().
| bool palindrome_tester< Char, Traits >::operator() | ( | string const & | str | ) | const [inline] |
Determine whether str is a palindrome. Only letter characters are tested. Spaces and punctuation don't count. Empty strings are not palindromes because that's just too easy.
| str | the string to test |
str is the same forward and backward Definition at line 51 of file palindrome.cpp.
References palindrome_tester< Char, Traits >::isalpha(), and palindrome_tester< Char, Traits >::lowercase().
1.5.3