재정렬 된 bool operator<(const std::string & rhs)
연산자를 사용할 때 문자열이 사전 식 비교되는지 확인하십시오. 예 :C++ : 사전 식 문자열 비교
std::string str1 = "aabbcc"
std::string str2 = "bbaacc"
(str1 < str2) == std::lexicographical_compare(str1.begin(),str1.end(),str2.begin(),str2.end()) // is this statement true?
예 문자열 비교가 사전 식으로 수행되지 않은 경우에는 동일하지 않습니다. – EdChum
@EdChum : 실제로 말이 될 수 있습니다. 일부 로케일 비교는 사전식이 아닙니다. – jpalecek
@jpalecek 흠, 그래서 나는 항상 이런 것들을 서부 (ASCII) 땅에서 생각하는 경향이 있다고 생각합니다. – EdChum