summaryrefslogtreecommitdiff
path: root/libstdc++/std
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-20 12:21:51 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1999-02-20 12:21:51 +0000
commitbf0521a145614c7ea50c410e71dd8d4a46f10151 (patch)
tree5e8d124a1069319a1889f86df2ba629433624ceb /libstdc++/std
parent1d04086fdc98b52c5c7afe54448304d08f4f40e3 (diff)
downloadgcc-bf0521a145614c7ea50c410e71dd8d4a46f10151.tar.gz
* string, std/straits.h, std/bastring.h: Revert recent change. Needs
some libiberty support before it can be re-enabled. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@25336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++/std')
-rw-r--r--libstdc++/std/bastring.h3
-rw-r--r--libstdc++/std/straits.h14
2 files changed, 5 insertions, 12 deletions
diff --git a/libstdc++/std/bastring.h b/libstdc++/std/bastring.h
index 30fb669a842..f188628cc77 100644
--- a/libstdc++/std/bastring.h
+++ b/libstdc++/std/bastring.h
@@ -298,8 +298,7 @@ private:
public:
const charT* c_str () const
- { if (length () == 0) return traits::empty();
- terminate (); return data (); }
+ { if (length () == 0) return ""; terminate (); return data (); }
void resize (size_type n, charT c);
void resize (size_type n)
{ resize (n, eos ()); }
diff --git a/libstdc++/std/straits.h b/libstdc++/std/straits.h
index b510ac74a96..c80e7ab7a68 100644
--- a/libstdc++/std/straits.h
+++ b/libstdc++/std/straits.h
@@ -40,8 +40,6 @@ template <class charT>
struct string_char_traits {
typedef charT char_type; // for users to acquire the basic character type
- static const char_type __nullstr[1];
-
// constraints
static void assign (char_type& c1, const char_type& c2)
@@ -53,10 +51,9 @@ struct string_char_traits {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return char_type(); } // the null character
- static char_type* empty() { return __nullstr; }
static bool is_del(char_type a) { return 0; }
// characteristic function for delimiters of charT
-
+
// speed-up functions
static int compare (const char_type* s1, const char_type* s2, size_t n)
@@ -68,7 +65,7 @@ struct string_char_traits {
return 0;
}
-
+
static size_t length (const char_type* s)
{
size_t l = 0;
@@ -120,7 +117,6 @@ struct string_char_traits <char> {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
- static char_type* empty() { return ""; }
static bool is_del(char_type a) { return isspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n)
@@ -135,8 +131,8 @@ struct string_char_traits <char> {
{ return (char_type*) memset (s1, c, n); }
};
+#if 0
#include <cwctype>
-#include <cwchar>
struct string_char_traits <wchar_t> {
typedef wchar_t char_type;
@@ -149,7 +145,6 @@ struct string_char_traits <wchar_t> {
static bool lt (const char_type& c1, const char_type& c2)
{ return (c1 < c2); }
static char_type eos () { return 0; }
- static char_type* empty() { return L""; }
static bool is_del(char_type a) { return iswspace(a); }
static int compare (const char_type* s1, const char_type* s2, size_t n)
@@ -158,10 +153,9 @@ struct string_char_traits <wchar_t> {
{ return wcslen (s); }
static char_type* copy (char_type* s1, const char_type* s2, size_t n)
{ return wmemcpy (s1, s2, n); }
- static char_type* move (char_type* s1, const char_type* s2, size_t n)
- { return (char_type*) wmemmove (s1, s2, n); }
static char_type* set (char_type* s1, const char_type& c, size_t n)
{ return wmemset (s1, c, n); }
};
+#endif
} // extern "C++"
#endif