Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
2 * Copyright (c) 1997-1999
3 * Silicon Graphics Computer Systems, Inc.
8 * This material is provided "as is", with absolutely no warranty expressed
9 * or implied. Any use is at your own risk.
11 * Permission to use or copy this software for any purpose is hereby granted
12 * without fee, provided the above notices are retained on all copies.
13 * Permission to modify the code and to distribute modified code is granted,
14 * provided the above notices are retained, and a notice that the code was
15 * modified is included with the above copyright notice.
19 #ifndef _STLP_DBG_STRING_H
20 #define _STLP_DBG_STRING_H
22 #include <stl/debug/_iterator.h>
24 # define _STLP_DBG_STRING_BASE _Nondebug_string <_CharT, _Traits, _Alloc>
28 # ifdef _STLP_DEBUG_USE_DISTINCT_VALUE_TYPE_HELPERS
29 template <class _CharT,class _Traits, class _Alloc>
31 value_type(const _DBG_iter_base< _STLP_DBG_STRING_BASE >&) {
34 template <class _CharT, class _Traits, class _Alloc>
35 inline random_access_iterator_tag
36 iterator_category(const _DBG_iter_base< _STLP_DBG_STRING_BASE >&) {
37 return random_access_iterator_tag();
41 template <class _CharT, class _Traits, class _Alloc>
42 class basic_string : public _STLP_DBG_STRING_BASE {
44 typedef _STLP_DBG_STRING_BASE _Base;
45 typedef basic_string<_CharT, _Traits, _Alloc> _Self;
47 mutable __owned_list _M_iter_list;
49 __IMPORT_CONTAINER_TYPEDEFS(_Base)
50 typedef _DBG_iter<_Base, _Nonconst_traits<value_type> > iterator;
51 typedef _DBG_iter<_Base, _Const_traits<value_type> > const_iterator;
52 _STLP_DECLARE_RANDOM_ACCESS_REVERSE_ITERATORS;
53 # ifdef _STLP_USE_NATIVE_STRING
54 // this typedef is being used for conversions
55 typedef _STLP_VENDOR_STD::basic_string<_CharT,_Traits,
56 _STLP_VENDOR_STD::allocator<_CharT> > __std_string;
58 public: // Constructor, destructor, assignment.
59 typedef typename _Base::_Reserve_t _Reserve_t;
61 const _Base* _Get_base() const { return (const _Base*)this; }
62 _Base* _Get_base() { return (_Base*)this; }
64 basic_string() :_STLP_DBG_STRING_BASE(), _M_iter_list(_Get_base()) {}
66 explicit basic_string(const allocator_type& __a):
67 _STLP_DBG_STRING_BASE(__a), _M_iter_list(_Get_base()) {}
69 basic_string(_Reserve_t __r, size_t __n,
70 const allocator_type& __a = allocator_type())
71 : _STLP_DBG_STRING_BASE(__r, __n, __a), _M_iter_list(_Get_base()) {}
73 basic_string(const _Self& __s):
74 _STLP_DBG_STRING_BASE(__s), _M_iter_list(_Get_base()) {}
76 basic_string(const _Self& __s, size_type __pos, size_type __n = _Base::npos,
77 const allocator_type& __a = allocator_type()):
78 _STLP_DBG_STRING_BASE(__s, __pos, __n, __a), _M_iter_list(_Get_base()) {}
80 basic_string(const _CharT* __s, size_type __n,
81 const allocator_type& __a = allocator_type()):
82 _STLP_DBG_STRING_BASE(__s, __n, __a), _M_iter_list(_Get_base()) {}
84 basic_string(const _CharT* __s,
85 const allocator_type& __a = allocator_type()):
86 _STLP_DBG_STRING_BASE(__s, __a), _M_iter_list(_Get_base()) {}
88 basic_string(size_type __n, _CharT __c,
89 const allocator_type& __a = allocator_type()):
90 _STLP_DBG_STRING_BASE(__n, __c, __a), _M_iter_list(_Get_base()) {}
92 #if defined (_STLP_MEMBER_TEMPLATES) && !(defined(__MRC__)||(defined(__SC__) && !defined(__DMC__)))
93 # ifdef _STLP_NEEDS_EXTRA_TEMPLATE_CONSTRUCTORS
94 template <class _InputIterator>
95 basic_string(_InputIterator __f, _InputIterator __l):
96 _STLP_DBG_STRING_BASE(__f, __l), _M_iter_list(_Get_base()) {}
98 template <class _InputIterator>
99 basic_string(_InputIterator __f, _InputIterator __l,
100 const allocator_type & __a _STLP_ALLOCATOR_TYPE_DFL):
101 _STLP_DBG_STRING_BASE(__f, __l, __a), _M_iter_list(_Get_base()) {}
102 #else /* _STLP_MEMBER_TEMPLATES */
103 basic_string(const_iterator __f, const_iterator __l,
104 const allocator_type & __a = allocator_type()):
105 _STLP_DBG_STRING_BASE(__f._M_iterator, __l._M_iterator, __a),
106 _M_iter_list(_Get_base()) {}
108 basic_string(const _CharT* __f, const _CharT* __l,
109 const allocator_type& __a = allocator_type()):
110 _STLP_DBG_STRING_BASE(__f, __l, __a), _M_iter_list(_Get_base()) {}
113 # ifdef _STLP_USE_NATIVE_STRING
114 // these conversion operations still needed for
116 basic_string (const __std_string& __x)
117 : _STLP_DBG_STRING_BASE(__x.begin(), __x.end()), _M_iter_list(_Get_base()) {}
118 operator __std_string() const { return __std_string(this->data()); }
121 // constructor from non-debug version
122 basic_string (const _Base& __x)
123 : _STLP_DBG_STRING_BASE(__x), _M_iter_list(_Get_base()) {}
125 _Self& operator=(const _Self& __s) {
126 _Base::operator=(__s);
130 _Self& operator=(const _CharT* __s) {
131 _STLP_FIX_LITERAL_BUG(__s)
132 _Base::operator=(__s);
136 _Self& operator=(_CharT __c) {
137 _Base::operator=(__c);
141 public: // Iterators.
143 iterator begin() { return iterator(&_M_iter_list, this->_M_start); }
144 const_iterator begin() const { return const_iterator(&_M_iter_list,this->_M_start); }
145 iterator end() { return iterator(&_M_iter_list,this->_M_finish); }
146 const_iterator end() const { return const_iterator(&_M_iter_list,this->_M_finish); }
147 void _M_deallocate_block() {
148 _M_iter_list._Invalidate_all();
149 _Base::_M_deallocate_block();
152 reverse_iterator rbegin()
153 { return reverse_iterator(iterator(&_M_iter_list,this->_M_finish)); }
154 reverse_iterator rend()
155 { return reverse_iterator(iterator(&_M_iter_list,this->_M_start)); }
156 const_reverse_iterator rbegin() const
157 { return const_reverse_iterator(const_iterator(&_M_iter_list,this->_M_finish)); }
158 const_reverse_iterator rend() const
159 { return const_reverse_iterator(const_iterator(&_M_iter_list,this->_M_start)); }
161 public: // Size, capacity, etc.
163 void resize(size_type __n, _CharT __c) {
164 _Base::resize(__n, __c);
166 void resize(size_type __n) { resize(__n, this->_M_null()); }
168 void reserve(size_type __s= 0) {
173 _M_iter_list._Invalidate_all();
177 public: // Element access.
179 const_reference operator[](size_type __n) const
180 { return *(begin() + __n); }
181 reference operator[](size_type __n)
182 { return *(begin() + __n); }
184 const_reference at(size_type __n) const {
185 if (__n >= this->size())
186 this->_M_throw_out_of_range();
187 return *(begin() + __n);
190 reference at(size_type __n) {
191 if (__n >= this->size())
192 this->_M_throw_out_of_range();
193 return *(begin() + __n);
196 public: // Append, operator+=, push_back.
198 _Self& operator+=(const _Self& __s) { return append(__s); }
199 _Self& operator+=(const _CharT* __s) { _STLP_FIX_LITERAL_BUG(__s) return append(__s); }
200 _Self& operator+=(_CharT __c) { push_back(__c); return *this; }
202 _Self& append(const _Self& __s) { return append(__s._M_start, __s._M_finish); }
204 _Self& append(const _Self& __s,
205 size_type __pos, size_type __n)
207 _Base::append(__s, __pos, __n);
211 _Self& append(const _CharT* __s, size_type __n)
212 { _STLP_FIX_LITERAL_BUG(__s) return append(__s, __s+__n); }
214 _Self& append(const _CharT* __s)
215 { _STLP_FIX_LITERAL_BUG(__s) return append(__s, __s + _Traits::length(__s)); }
217 _Self& append(size_type __n, _CharT __c){
218 _Base::append(__n, __c);
222 #ifdef _STLP_MEMBER_TEMPLATES
224 // Check to see if _InputIterator is an integer type. If so, then
225 // it can't be an iterator.
226 template <class _InputIter>
227 _Self& append(_InputIter __first, _InputIter __last) {
228 _Base::append(__first, __last);
233 // specialization for append
235 inline _Self& append(iterator __f, iterator __l) {
236 _STLP_FIX_LITERAL_BUG(__f) _STLP_FIX_LITERAL_BUG(__l)
237 __check_range(__f, __l);
238 _Base::append(__f._M_iterator, __l._M_iterator);
243 #else /* _STLP_MEMBER_TEMPLATES */
245 _Self& append(const _CharT* __first, const _CharT* __last) {
246 _Base::append(__first, __last);
250 _Self& append(const_iterator __first, const_iterator __last) {
251 _Base::append(__first._M_iterator, __last._M_iterator);
254 #endif /* _STLP_MEMBER_TEMPLATES */
256 void push_back(_CharT __c) {
257 _Base::push_back(__c);
261 __invalidate_iterator(&_M_iter_list,end());
268 _Self& assign(const _Self& __s) {
273 _Self& assign(const _Self& __s,
274 size_type __pos, size_type __n) {
275 _Base::assign(__s, __pos, __n);
279 _Self& assign(const _CharT* __s, size_type __n)
280 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + __n); }
282 _Self& assign(const _CharT* __s)
283 { _STLP_FIX_LITERAL_BUG(__s) return assign(__s, __s + _Traits::length(__s)); }
285 _Self& assign(size_type __n, _CharT __c) {
286 _Base::assign(__n, __c);
290 #ifdef _STLP_MEMBER_TEMPLATES
291 template <class _InputIter>
292 inline _Self& assign(_InputIter __first, _InputIter __last) {
293 _STLP_FIX_LITERAL_BUG(__first) _STLP_FIX_LITERAL_BUG(__last)
294 __check_range(__first, __last);
295 _Base::assign(__first, __last);
300 // partial specialization for assign
302 inline _Self& assign(iterator __f, iterator __l) {
303 _STLP_FIX_LITERAL_BUG(__f) _STLP_FIX_LITERAL_BUG(__l)
304 __check_range(__f, __l);
305 _Base::assign(__f._M_iterator, __l._M_iterator);
311 _Self& assign(const _CharT* __f, const _CharT* __l) {
312 _STLP_FIX_LITERAL_BUG(__f) _STLP_FIX_LITERAL_BUG(__l)
313 __check_range(__f, __l);
314 _Base::assign(__f, __l);
317 _Self& assign(const_iterator __f, const_iterator __l) {
319 _Base::assign(__f._M_iterator, __l._M_iterator);
322 #endif /* _STLP_MEMBER_TEMPLATES */
326 _Self& insert(size_type __pos, const _Self& __s) {
327 _Base::insert(__pos, __s);
331 _Self& insert(size_type __pos, const _Self& __s,
332 size_type __beg, size_type __n) {
333 _Base::insert(__pos, __s, __beg, __n);
337 _Self& insert(size_type __pos, const _CharT* __s, size_type __n) {
338 _STLP_FIX_LITERAL_BUG(__s)
339 _Base::insert(__pos, __s, __n);
343 _Self& insert(size_type __pos, const _CharT* __s) {
344 _STLP_FIX_LITERAL_BUG(__s)
345 _Base::insert(__pos, __s);
349 _Self& insert(size_type __pos, size_type __n, _CharT __c) {
350 _Base::insert(__pos, __n, __c);
354 iterator insert(iterator __p, _CharT __c) {
355 _STLP_FIX_LITERAL_BUG(__p)
356 __check_if_owner(&_M_iter_list,__p);
357 return iterator(&_M_iter_list,_Base::insert(__p._M_iterator, __c));
360 void insert(iterator __p, size_t __n, _CharT __c) {
361 __check_if_owner(&_M_iter_list,__p);
362 _Base::insert(__p._M_iterator, __n, __c);
365 #ifdef _STLP_MEMBER_TEMPLATES
366 template <class _InputIter>
367 void insert(iterator __p, _InputIter __first, _InputIter __last) {
368 __check_if_owner(&_M_iter_list,__p);
369 __check_range(__first,__last);
370 _Base::insert(__p._M_iterator, __first, __last);
372 #else /* _STLP_MEMBER_TEMPLATES */
373 void insert(iterator __p, const _CharT* __first, const _CharT* __last) {
374 _STLP_FIX_LITERAL_BUG(__first) _STLP_FIX_LITERAL_BUG(__last)
375 __check_if_owner(&_M_iter_list,__p);
376 __check_range(__first,__last);
377 _Base::insert(__p._M_iterator, __first, __last);
379 void insert(iterator __p, const_iterator __first, const_iterator __last) {
380 __check_range(__first,__last);
381 _Base::insert(__p._M_iterator, __first._M_iterator, __last._M_iterator);
383 #endif /* _STLP_MEMBER_TEMPLATES */
386 _Self& erase(size_type __pos = 0, size_type __n = _Base::npos) {
387 _Base::erase(__pos, __n);
390 iterator erase(iterator __position) {
391 __check_if_owner(&_M_iter_list, __position);
392 __invalidate_iterator(&_M_iter_list,end());
393 return iterator(&_M_iter_list, _Base::erase(__position._M_iterator));
395 iterator erase(iterator __first, iterator __last) {
396 __check_range(__first, __last)&&__check_if_owner(&_M_iter_list,__first);
397 if (__first != __last) {
398 __invalidate_range(&_M_iter_list, __last, end());
400 return iterator(&_M_iter_list, _Base::erase(__first._M_iterator, __last._M_iterator));
403 public: // Substring.
404 _Self substr(size_type __pos = 0, size_type __n = _Base::npos) const {
405 if (__pos > this->size())
406 this->_M_throw_out_of_range();
407 return _Self(this->begin() + __pos,
408 this->begin() + __pos + min(__n, this->size() - __pos),
411 public: // Replace. (Conceptually equivalent
412 // to erase followed by insert.)
413 _Self& replace(size_type __pos, size_type __n,
415 _Base::replace(__pos, __n, __s);
419 _Self& replace(size_type __pos1, size_type __n1,
421 size_type __pos2, size_type __n2) {
422 _Base::replace(__pos1, __n1, (const _Base&)__s, __pos2, __n2);
426 _Self& replace(size_type __pos, size_type __n1,
427 const _CharT* __s, size_type __n2) {
428 _STLP_FIX_LITERAL_BUG(__s)
429 _Base::replace(__pos, __n1, __s, __n2);
433 _Self& replace(size_type __pos, size_type __n1,
435 _STLP_FIX_LITERAL_BUG(__s)
436 _Base::replace(__pos, __n1, __s);
440 _Self& replace(size_type __pos, size_type __n1,
441 size_type __n2, _CharT __c) {
442 _Base::replace(__pos, __n1, __n2, __c);
446 _Self& replace(iterator __first, iterator __last,
448 __check_if_owner(&_M_iter_list,__first);
449 __check_range(__first, __last);
450 _Base::replace(__first._M_iterator, __last._M_iterator,__s);
454 _Self& replace(iterator __first, iterator __last,
455 const _CharT* __s, size_type __n) {
456 _STLP_FIX_LITERAL_BUG(__s)
457 __check_if_owner(&_M_iter_list,__first);
458 __check_range(__first, __last);
459 _Base::replace(__first._M_iterator, __last._M_iterator,__s, __n);
463 _Self& replace(iterator __first, iterator __last,
465 _STLP_FIX_LITERAL_BUG(__s)
466 __check_if_owner(&_M_iter_list,__first);
467 __check_range(__first, __last);
468 _Base::replace(__first._M_iterator, __last._M_iterator,__s);
472 _Self& replace(iterator __first, iterator __last,
473 size_type __n, _CharT __c) {
474 __check_if_owner(&_M_iter_list,__first);
475 __check_range(__first, __last);
476 _Base::replace(__first._M_iterator, __last._M_iterator, __n, __c);
480 #ifdef _STLP_MEMBER_TEMPLATES
481 template <class _InputIter>
482 _Self& replace(iterator __first, iterator __last,
483 _InputIter __f, _InputIter __l) {
484 __check_if_owner(&_M_iter_list, __first);
485 __check_range(__first, __last);
486 __check_range(__f, __l);
487 _Base::replace(__first._M_iterator, __last._M_iterator, __f, __l);
490 #else /* _STLP_MEMBER_TEMPLATES */
491 _Self& replace(iterator __first, iterator __last,
492 const _CharT* __f, const _CharT* __l) {
493 __check_if_owner(&_M_iter_list, __first);
494 __check_range(__first, __last);
495 __check_range(__f, __l);
496 _Base::replace(__first._M_iterator, __last._M_iterator, __f, __l);
500 _Self& replace(iterator __first, iterator __last,
501 const_iterator __f, const_iterator __l) {
502 __check_if_owner(&_M_iter_list, __first);
503 __check_range(__first, __last);
504 __check_range(__f, __l);
505 _Base::replace(__first._M_iterator, __last._M_iterator,
506 __f._M_iterator, __l._M_iterator);
509 #endif /* _STLP_MEMBER_TEMPLATES */
511 public: // Other modifier member functions.
513 void swap(_Self& __s) {
514 _M_iter_list._Swap_owners(__s._M_iter_list);
520 // This is a hook to instantiate STLport exports in a designated DLL
521 # if defined (_STLP_USE_TEMPLATE_EXPORT)
522 _STLP_EXPORT template class _STLP_CLASS_DECLSPEC basic_string<char, char_traits<char>, allocator<char> >;
523 # if defined (_STLP_HAS_WCHAR_T)
524 _STLP_EXPORT template class _STLP_CLASS_DECLSPEC basic_string<wchar_t, char_traits<wchar_t>, allocator<wchar_t> >;
526 # endif /* _STLP_USE_TEMPLATE_EXPORT */
529 // ------------------------------------------------------------
530 // Non-member functions.
532 template <class _CharT, class _Traits, class _Alloc>
533 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
534 operator+(const basic_string<_CharT,_Traits,_Alloc>& __s,
535 const basic_string<_CharT,_Traits,_Alloc>& __y)
537 return basic_string<_CharT,_Traits,_Alloc>(*__s._Get_base() + *__y._Get_base());
540 template <class _CharT, class _Traits, class _Alloc>
541 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
542 operator+(const _CharT* __s,
543 const basic_string<_CharT,_Traits,_Alloc>& __y) {
544 _STLP_FIX_LITERAL_BUG(__s)
545 return basic_string<_CharT,_Traits,_Alloc>(__s + *__y._Get_base());
548 template <class _CharT, class _Traits, class _Alloc>
549 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
550 operator+(_CharT __c,
551 const basic_string<_CharT,_Traits,_Alloc>& __y) {
552 return basic_string<_CharT,_Traits,_Alloc>(__c + *__y._Get_base());
555 template <class _CharT, class _Traits, class _Alloc>
556 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
557 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x,
559 _STLP_FIX_LITERAL_BUG(__s)
560 return basic_string<_CharT,_Traits,_Alloc>(*__x._Get_base()+ __s);
563 template <class _CharT, class _Traits, class _Alloc>
564 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
565 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x,
567 return basic_string<_CharT,_Traits,_Alloc>(*__x._Get_base() + __c);
570 #ifdef _STLP_EXTRA_OPERATORS_FOR_DEBUG
572 // Operator== and operator!=
574 template <class _CharT, class _Traits, class _Alloc>
575 inline bool _STLP_CALL
576 operator==(const basic_string<_CharT,_Traits,_Alloc>& __x,
577 const basic_string<_CharT,_Traits,_Alloc>& __y) {
578 return (*__x._Get_base() == *__y._Get_base());
581 template <class _CharT, class _Traits, class _Alloc>
582 inline bool _STLP_CALL
583 operator==(const _CharT* __s,
584 const basic_string<_CharT,_Traits,_Alloc>& __y) {
585 _STLP_FIX_LITERAL_BUG(__s)
586 return (__s == *__y._Get_base());
589 template <class _CharT, class _Traits, class _Alloc>
590 inline bool _STLP_CALL
591 operator==(const basic_string<_CharT,_Traits,_Alloc>& __x,
593 _STLP_FIX_LITERAL_BUG(__s)
594 return (*__x._Get_base() == __s);
597 // Operator< (and also >, <=, and >=).
599 template <class _CharT, class _Traits, class _Alloc>
600 inline bool _STLP_CALL
601 operator<(const basic_string<_CharT,_Traits,_Alloc>& __x,
602 const basic_string<_CharT,_Traits,_Alloc>& __y) {
603 return (*__x._Get_base() < *__y._Get_base());
606 template <class _CharT, class _Traits, class _Alloc>
607 inline bool _STLP_CALL
608 operator<(const _CharT* __s,
609 const basic_string<_CharT,_Traits,_Alloc>& __y) {
610 _STLP_FIX_LITERAL_BUG(__s)
611 return (__s < *__y._Get_base());
614 template <class _CharT, class _Traits, class _Alloc>
615 inline bool _STLP_CALL
616 operator<(const basic_string<_CharT,_Traits,_Alloc>& __x,
618 _STLP_FIX_LITERAL_BUG(__s)
619 return (*__x._Get_base() < __s);
622 #ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
624 template <class _CharT, class _Traits, class _Alloc>
625 inline bool _STLP_CALL
626 operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,
627 const basic_string<_CharT,_Traits,_Alloc>& __y) {
628 return !(__x == __y);
631 template <class _CharT, class _Traits, class _Alloc>
632 inline bool _STLP_CALL
633 operator>(const basic_string<_CharT,_Traits,_Alloc>& __x,
634 const basic_string<_CharT,_Traits,_Alloc>& __y) {
638 template <class _CharT, class _Traits, class _Alloc>
639 inline bool _STLP_CALL
640 operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,
641 const basic_string<_CharT,_Traits,_Alloc>& __y) {
645 template <class _CharT, class _Traits, class _Alloc>
646 inline bool _STLP_CALL
647 operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,
648 const basic_string<_CharT,_Traits,_Alloc>& __y) {
652 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
654 template <class _CharT, class _Traits, class _Alloc>
655 inline bool _STLP_CALL
656 operator!=(const _CharT* __s,
657 const basic_string<_CharT,_Traits,_Alloc>& __y) {
658 _STLP_FIX_LITERAL_BUG(__s)
659 return !(__s == __y);
662 template <class _CharT, class _Traits, class _Alloc>
663 inline bool _STLP_CALL
664 operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,
666 _STLP_FIX_LITERAL_BUG(__s)
667 return !(__x == __s);
670 template <class _CharT, class _Traits, class _Alloc>
671 inline bool _STLP_CALL
672 operator>(const _CharT* __s,
673 const basic_string<_CharT,_Traits,_Alloc>& __y) {
674 _STLP_FIX_LITERAL_BUG(__s)
678 template <class _CharT, class _Traits, class _Alloc>
679 inline bool _STLP_CALL
680 operator>(const basic_string<_CharT,_Traits,_Alloc>& __x,
682 _STLP_FIX_LITERAL_BUG(__s)
686 template <class _CharT, class _Traits, class _Alloc>
687 inline bool _STLP_CALL
688 operator<=(const _CharT* __s,
689 const basic_string<_CharT,_Traits,_Alloc>& __y) {
690 _STLP_FIX_LITERAL_BUG(__s)
694 template <class _CharT, class _Traits, class _Alloc>
695 inline bool _STLP_CALL
696 operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,
698 _STLP_FIX_LITERAL_BUG(__s)
702 template <class _CharT, class _Traits, class _Alloc>
703 inline bool _STLP_CALL
704 operator>=(const _CharT* __s,
705 const basic_string<_CharT,_Traits,_Alloc>& __y) {
706 _STLP_FIX_LITERAL_BUG(__s)
710 template <class _CharT, class _Traits, class _Alloc>
711 inline bool _STLP_CALL
712 operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,
714 _STLP_FIX_LITERAL_BUG(__s)
720 #ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER
721 template <class _CharT, class _Traits, class _Alloc>
722 inline void swap(basic_string<_CharT,_Traits,_Alloc>& __x,
723 basic_string<_CharT,_Traits,_Alloc>& __y) {
726 #endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
730 #ifdef _STLP_EXTRA_OPERATORS_FOR_DEBUG
731 #if defined (_STLP_USE_NEW_IOSTREAMS) && ! defined (_STLP_OWN_IOSTREAMS)
733 template <class _CharT, class _Traits, class _Alloc>
734 basic_ostream<_CharT, _Traits>& _STLP_CALL
735 operator<<(basic_ostream<_CharT, _Traits>& __os,
736 const basic_string<_CharT,_Traits,_Alloc>& __s) {
737 return __os << *__s._Get_base();
740 template <class _CharT, class _Traits, class _Alloc>
741 basic_istream<_CharT, _Traits>& _STLP_CALL
742 operator>>(basic_istream<_CharT, _Traits>& __is,
743 basic_string<_CharT,_Traits,_Alloc>& __s) {
744 return __is >> *__s._Get_base();
747 #elif ! defined ( _STLP_USE_NO_IOSTREAMS )
749 template <class _CharT, class _Traits, class _Alloc>
750 ostream& _STLP_CALL operator<<(ostream& __os,
751 const basic_string<_CharT,_Traits,_Alloc>& __s) {
752 return __os << *__s._Get_base();
755 template <class _CharT, class _Traits, class _Alloc>
756 istream& _STLP_CALL operator>>(istream& __is, basic_string<_CharT,_Traits,_Alloc>& __s) {
757 return __is >> *__s._Get_base();
760 #endif /* _STLP_USE_NEW_IOSTREAMS */
761 #endif /* if _STLP_EXTRA_OPERATORS_FOR_DEBUG */
766 #endif /* _STLP_DBG_STRING */