402N/A InputIterator (const char *p): p_ (p) { }
402N/A- char operator* () const { return *p_; }
402N/A+ // 24.1.1, t72: *a must be _convertible_ to T
402N/A+ // 24.1.1, p3: "Value type T is not required to be
402N/A+ // an Assignable type (23.1)."
402N/A+ // Also see 24.5.1.2, p1
402N/A+ const char& operator* () const { return *p_; }
402N/A InputIterator& operator++ () { return ++p_, *this; }
402N/A InputIterator operator++ (int) {
402N/A return ++p_, InputIterator (p_ - 1);
402N/A+/************************************************************************
402N/A+***************************************************************************
402N/A+* Licensed to the Apache Software Foundation (ASF) under one or more
402N/A+* contributor license agreements. See the NOTICE file distributed
402N/A+* with this work for additional information regarding copyright
402N/A+* ownership. The ASF licenses this file to you under the Apache
402N/A+* License, Version 2.0 (the "License"); you may not use this file
402N/A+* except in compliance with the License. You may obtain a copy of
402N/A+* Unless required by applicable law or agreed to in writing, software
402N/A+* distributed under the License is distributed on an "AS IS" BASIS,
402N/A+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
402N/A+* implied. See the License for the specific language governing
402N/A+* permissions and limitations under the License.
402N/A+**************************************************************************/
402N/A+#ifndef _RWSTD_NO_REPLACEABLE_NEW_DELETE
402N/A+ // disabled for compilers that can't reliably replace the operators
402N/A+void* operator new (std::size_t n) throw (std::bad_alloc)
402N/A+ void* const ptr = std::malloc (n + sizeof n);
402N/A+ std::memset (ptr, -1, n);
402N/A+ *(std::size_t*)ptr = n;
402N/A+ return (std::size_t*)ptr + 1;
402N/A+void operator delete (void *ptr) throw ()
402N/A+ std::memset (ptr, -1, *((std::size_t*)ptr - 1));
402N/A+ std::free ((std::size_t*)ptr - 1);
402N/A+#endif // _RWSTD_NO_REPLACEABLE_NEW_DELETE
402N/A+struct InputIterator: std::iterator<std::input_iterator_tag, char>
402N/A+ InputIterator (const char *p): p_ (p) { }
402N/A+ // 24.1.1, t72: *a must be _convertible_ to T
402N/A+ // 24.1.1, p3: "Value type T is not required to be
402N/A+ // an Assignable type (23.1)."
402N/A+ // Also see 24.5.1.2, p1
402N/A+ const char& operator* () const { return *p_; }
402N/A+ InputIterator& operator++ () { return ++p_, *this; }
402N/A+ InputIterator operator++ (int) {
402N/A+ return ++p_, InputIterator (p_ - 1);
402N/A+ bool operator== (const InputIterator &rhs) const { return p_ ==
rhs.p_; }
402N/A+ const char s[] = "abc";
402N/A+ const char* p0 = s + 1;
402N/A+ const char* p1 = p0 + 1;
402N/A+ const InputIterator first (p0);
402N/A+ const InputIterator last (p1);
402N/A+ assert ("abcb" == str);
402N/A+ const char* p1 = p0 + 1;
402N/A+ const InputIterator first (p0);
402N/A+ const InputIterator last (p1);
402N/A+ assert ("abcb" == str);