mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-08-04 09:46:10 -04:00
Fix constness
This commit is contained in:
parent
7bf689f9b5
commit
5b38e18e94
@ -479,7 +479,7 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Lexicographically compare strings
|
* \brief Lexicographically compare strings
|
||||||
*/
|
*/
|
||||||
int compare(basic_string& rhs){
|
int compare(basic_string& rhs) const noexcept {
|
||||||
return base_compare(rhs);
|
return base_compare(rhs);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,7 +487,7 @@ public:
|
|||||||
* \brief Lexicographically compare with string_view rhs
|
* \brief Lexicographically compare with string_view rhs
|
||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
int compare(const T& rhs){
|
int compare(const T& rhs) const noexcept {
|
||||||
basic_string_view<CharT> sv = rhs;
|
basic_string_view<CharT> sv = rhs;
|
||||||
|
|
||||||
return base_compare(sv);
|
return base_compare(sv);
|
||||||
@ -518,7 +518,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
int base_compare(const T& rhs){
|
int base_compare(const T& rhs) const noexcept {
|
||||||
for (size_t i = 0; i < rhs.size() && i < size(); ++i) {
|
for (size_t i = 0; i < rhs.size() && i < size(); ++i) {
|
||||||
if ((*this)[i] < rhs[i]) {
|
if ((*this)[i] < rhs[i]) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user