From 4c776ab0ca991987451803ef90115398b82f645b Mon Sep 17 00:00:00 2001 From: Mike Sharov Date: Wed, 22 Aug 2007 12:23:54 -0400 Subject: [PATCH] Removed single-char string::erase. After some consideration, I don't even see this as necessary. You just shouldn't touch individual wchar values. Period. --- ustring.cc | 8 -------- ustring.h | 5 +---- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/ustring.cc b/ustring.cc index c94a09c..e215433 100644 --- a/ustring.cc +++ b/ustring.cc @@ -217,14 +217,6 @@ string::iterator string::erase (iterator ep, size_type n) return (rv); } -/// Erases a single character at \p ep. -/// This is an exception to the general rule that all numbers are bytes, -/// since deleting a single byte never makes sense. -void string::erase (uoff_t epo) -{ - erase (iat(epo), Utf8SequenceBytes(at(epo))); -} - /// Erases \p n bytes at byte offset \p epo. void string::erase (uoff_t epo, size_type n) { diff --git a/ustring.h b/ustring.h index 1e3e7a7..f2ef891 100644 --- a/ustring.h +++ b/ustring.h @@ -42,8 +42,6 @@ namespace ustl { /// one thing or another. The only thing you can do to a localized string is /// search for delimiters and modify text between them as opaque blocks. If you /// do anything else, you are hardcoding yourself into a locale! So stop it! -/// A single exception is provided in the erase(epo) call, where there is no -/// size provided, and only erasing the whole character makes sense. /// class string : public memblock { public: @@ -150,8 +148,7 @@ public: inline void insert (uoff_t ip, size_type n, value_type c) { insert (iat(ip), c, n); } inline void insert (uoff_t ip, const string& s, uoff_t sp, size_type slen) { insert (iat(ip), s.iat(sp), s.iat(sp + slen)); } iterator erase (iterator epo, size_type n = 1); - void erase (uoff_t epo); - void erase (uoff_t epo, size_type n); + void erase (uoff_t epo, size_type n = 1); inline iterator erase (iterator first, const_iterator last) { return (erase (first, size_type(distance(first,last)))); } inline void eraser (uoff_t first, uoff_t last) { erase (iat(first), iat(last)); } inline void push_back (const_reference c) { append (1, c); } -- 2.11.4.GIT