mirror of
https://review.haiku-os.org/buildtools
synced 2024-11-23 15:29:11 +01:00
Add another standard C++ prototype for string::compare.
This commit is contained in:
parent
a060af0916
commit
24ebe81445
@ -408,17 +408,18 @@ public:
|
||||
basic_string substr (size_type pos = 0, size_type n = npos) const
|
||||
{ return basic_string (*this, pos, n); }
|
||||
|
||||
int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
|
||||
// There is no 'strncmp' equivalent for charT pointers.
|
||||
|
||||
// BeOS bogus version
|
||||
int compare (const charT* s, size_type pos, size_type n) const;
|
||||
int compare (const basic_string& str, size_type pos = 0, size_type n = npos) const;
|
||||
// There is no 'strncmp' equivalent for charT pointers.
|
||||
|
||||
// Correct std C++ prototype
|
||||
int compare (size_type pos, size_type n, const charT* s) const
|
||||
{ return compare(s, pos, n); }
|
||||
int compare (const charT* s, size_type pos = 0) const
|
||||
{ return compare (s, pos, traits::length (s)); }
|
||||
int compare (size_type pos, size_type n, const basic_string& str) const
|
||||
{ return compare(str, pos, n); }
|
||||
|
||||
iterator begin () { selfish (); return &(*this)[0]; }
|
||||
iterator end () { selfish (); return &(*this)[length ()]; }
|
||||
|
Loading…
Reference in New Issue
Block a user