diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-18 12:03:35 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-18 12:03:35 +0000 |
commit | 9acadc12bc67e6cdb73fd376f3087e49b2919e23 (patch) | |
tree | bc73149696da051bfa175aaabfeeb69c2d25b183 /libstdc++-v3/include/bits/basic_string.tcc | |
parent | 938166feb76002d64dfaf9dcafe7e82f4f88d289 (diff) | |
download | gcc-9acadc12bc67e6cdb73fd376f3087e49b2919e23.tar.gz |
2007-01-18 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.h (basic_string<>::_S_compare): Add.
(compare(const basic_string&)): Use it.
* include/bits/basic_string.tcc (compare(size_type, size_type,
const basic_string&), compare(size_type, size_type,
const basic_string&, size_type, size_type), compare(const _CharT*),
compare(size_type, size_type, const _CharT*), compare(size_type,
size_type, const _CharT*, size_type)): Likewise.
* include/ext/vstring_util.h (__vstring_utility<>::_S_compare): Add.
* include/ext/vstring.h (compare(const __versa_string&)): Use it.
* include/ext/vstring.tcc (compare(size_type, size_type,
const __versa_string&), compare(size_type, size_type,
const __versa_string&, size_type, size_type), compare(const _CharT*),
compare(size_type, size_type, const _CharT*), compare(size_type,
size_type, const _CharT*, size_type)): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120896 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/basic_string.tcc')
-rw-r--r-- | libstdc++-v3/include/bits/basic_string.tcc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index fadf9b34ea1..3437fdaba4a 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -1,6 +1,7 @@ // Components for manipulating sequences of characters -*- C++ -*- -// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, +// 2006, 2007 // Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free @@ -902,7 +903,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n, __osize); int __r = traits_type::compare(_M_data() + __pos, __str.data(), __len); if (!__r) - __r = __n - __osize; + __r = _S_compare(__n, __osize); return __r; } @@ -920,7 +921,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) int __r = traits_type::compare(_M_data() + __pos1, __str.data() + __pos2, __len); if (!__r) - __r = __n1 - __n2; + __r = _S_compare(__n1, __n2); return __r; } @@ -935,7 +936,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__size, __osize); int __r = traits_type::compare(_M_data(), __s, __len); if (!__r) - __r = __size - __osize; + __r = _S_compare(__size, __osize); return __r; } @@ -951,7 +952,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n1, __osize); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) - __r = __n1 - __osize; + __r = _S_compare(__n1, __osize); return __r; } @@ -967,7 +968,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std) const size_type __len = std::min(__n1, __n2); int __r = traits_type::compare(_M_data() + __pos, __s, __len); if (!__r) - __r = __n1 - __n2; + __r = _S_compare(__n1, __n2); return __r; } |