⛏️ index : buildtools.git

author Adrien Destugues <pulkomandy@gmail.com> 2013-01-05 11:19:40.0 +01:00:00
committer Adrien Destugues <pulkomandy@gmail.com> 2013-01-05 11:19:40.0 +01:00:00
commit
8b70c20ed25f905e7e217376c9e2f65a8dee6729 [patch]
tree
493db1068ea827597cba3e8302b07f2183261efc
parent
85c4a8cee1811928616791a2a2972fe944b217cf
download
8b70c20ed25f905e7e217376c9e2f65a8dee6729.tar.gz

Add another standard C++ prototype for string::compare.



Diff

 legacy/gcc/libstdc++/std/bastring.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/legacy/gcc/libstdc++/std/bastring.h b/legacy/gcc/libstdc++/std/bastring.h
index 774f7be..a9c844d 100644
--- a/legacy/gcc/libstdc++/std/bastring.h
+++ a/legacy/gcc/libstdc++/std/bastring.h
@@ -408,17 +408,18 @@
  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 ()]; }