From 8b70c20ed25f905e7e217376c9e2f65a8dee6729 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sat, 05 Jan 2013 11:19:40 +0100 Subject: [PATCH] Add another standard C++ prototype for string::compare. --- 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 ()]; } -- gitore 0.2.1