/home/ntakagi/work/STLport-5.1.5/stlport/stl/_string_operators.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2003
00003  * Francois Dumont
00004  *
00005  * This material is provided "as is", with absolutely no warranty expressed
00006  * or implied. Any use is at your own risk.
00007  *
00008  * Permission to use or copy this software for any purpose is hereby granted
00009  * without fee, provided the above notices are retained on all copies.
00010  * Permission to modify the code and to distribute modified code is granted,
00011  * provided the above notices are retained, and a notice that the code was
00012  * modified is included with the above copyright notice.
00013  *
00014  */
00015 
00016 #ifndef _STLP_STRING_OPERATORS_H
00017 #define _STLP_STRING_OPERATORS_H
00018 
00019 _STLP_BEGIN_NAMESPACE
00020 
00021 #if !defined (_STLP_USE_TEMPLATE_EXPRESSION)
00022 
00023 #  if defined (__GNUC__) || defined (__MLCCPP__)
00024 #    define _STLP_INIT_AMBIGUITY 1
00025 #  endif
00026 
00027 template <class _CharT, class _Traits, class _Alloc>
00028 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
00029 operator+(const basic_string<_CharT,_Traits,_Alloc>& __s,
00030           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00031   typedef basic_string<_CharT,_Traits,_Alloc> _Str;
00032   typedef typename _Str::_Reserve_t _Reserve_t;
00033 #  if defined (_STLP_INIT_AMBIGUITY)
00034   // gcc counts this as a function
00035   _Str __result  = _Str(_Reserve_t(), __s.size() + __y.size(), __s.get_allocator());
00036 #  else
00037   _Str __result(_Reserve_t(), __s.size() + __y.size(), __s.get_allocator());
00038 #  endif
00039   __result.append(__s);
00040   __result.append(__y);
00041   return __result;
00042 }
00043 
00044 template <class _CharT, class _Traits, class _Alloc>
00045 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
00046 operator+(const _CharT* __s,
00047           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00048   _STLP_FIX_LITERAL_BUG(__s)
00049   typedef basic_string<_CharT,_Traits,_Alloc> _Str;
00050   typedef typename _Str::_Reserve_t _Reserve_t;
00051   const size_t __n = _Traits::length(__s);
00052 #  if defined (_STLP_INIT_AMBIGUITY)
00053   _Str __result = _Str(_Reserve_t(), __n + __y.size(), __y.get_allocator());
00054 #  else
00055   _Str __result(_Reserve_t(), __n + __y.size(), __y.get_allocator());
00056 #  endif
00057   __result.append(__s, __s + __n);
00058   __result.append(__y);
00059   return __result;
00060 }
00061 
00062 template <class _CharT, class _Traits, class _Alloc>
00063 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
00064 operator+(_CharT __c,
00065           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00066   typedef basic_string<_CharT,_Traits,_Alloc> _Str;
00067   typedef typename _Str::_Reserve_t _Reserve_t;
00068 #  if defined (_STLP_INIT_AMBIGUITY)
00069   _Str __result = _Str(_Reserve_t(), 1 + __y.size(), __y.get_allocator());
00070 #  else
00071   _Str __result(_Reserve_t(), 1 + __y.size(), __y.get_allocator());
00072 #  endif
00073   __result.push_back(__c);
00074   __result.append(__y);
00075   return __result;
00076 }
00077 
00078 template <class _CharT, class _Traits, class _Alloc>
00079 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
00080 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x,
00081           const _CharT* __s) {
00082   _STLP_FIX_LITERAL_BUG(__s)
00083   typedef basic_string<_CharT,_Traits,_Alloc> _Str;
00084   typedef typename _Str::_Reserve_t _Reserve_t;
00085   const size_t __n = _Traits::length(__s);
00086 #  if defined (_STLP_INIT_AMBIGUITY)
00087   _Str __result = _Str(_Reserve_t(), __x.size() + __n, __x.get_allocator());
00088 #  else
00089   _Str __result(_Reserve_t(), __x.size() + __n, __x.get_allocator());
00090 #  endif
00091   __result.append(__x);
00092   __result.append(__s, __s + __n);
00093   return __result;
00094 }
00095 
00096 template <class _CharT, class _Traits, class _Alloc>
00097 inline basic_string<_CharT,_Traits,_Alloc> _STLP_CALL
00098 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x,
00099           const _CharT __c) {
00100   typedef basic_string<_CharT,_Traits,_Alloc> _Str;
00101   typedef typename _Str::_Reserve_t _Reserve_t;
00102 #  if defined (_STLP_INIT_AMBIGUITY)
00103   _Str __result = _Str(_Reserve_t(), __x.size() + 1, __x.get_allocator());
00104 #  else
00105   _Str __result(_Reserve_t(), __x.size() + 1, __x.get_allocator());
00106 #  endif
00107   __result.append(__x);
00108   __result.push_back(__c);
00109   return __result;
00110 }
00111 
00112 #  undef _STLP_INIT_AMBIGUITY
00113 
00114 #else /* _STLP_USE_TEMPLATE_EXPRESSION */
00115 
00116 // addition with basic_string
00117 template <class _CharT, class _Traits, class _Alloc>
00118 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00119                              _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00120                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00121                                                    _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00122                                                    _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00123                                                    _STLP_PRIV __on_right>,
00124                              _STLP_PRIV __on_right> _STLP_CALL
00125 operator+(const basic_string<_CharT,_Traits,_Alloc>& __lhs,
00126           const basic_string<_CharT,_Traits,_Alloc>& __rhs) {
00127   typedef _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00128                                                          _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00129                                                          _STLP_PRIV __on_right> __root_type;
00130   __root_type __root(__rhs, _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>(__lhs.get_allocator()));
00131   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00132                                                         __root_type,
00133                                                         _STLP_PRIV __on_right>(__lhs, __root);
00134 }
00135 
00136 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00137 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00138                              _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00139                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00140                              _STLP_PRIV __on_right> _STLP_CALL
00141 operator+(const basic_string<_CharT,_Traits,_Alloc>& __lhs,
00142           const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __rhs) {
00143   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00144                                                         _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00145                                                         _STLP_PRIV __on_right>(__lhs, __rhs);
00146 }
00147 
00148 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00149 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00150                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00151                              _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00152                              _STLP_PRIV __on_left> _STLP_CALL
00153 operator+(const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __lhs,
00154           const basic_string<_CharT,_Traits,_Alloc>& __rhs) {
00155   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00156                                                         _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00157                                                         _STLP_PRIV __on_left>(__lhs, __rhs);
00158 }
00159 
00160 // addition with C string
00161 template <class _CharT, class _Traits, class _Alloc>
00162 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00163                              _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00164                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00165                                                    _STLP_PRIV __cstr_wrapper<_CharT>,
00166                                                    _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00167                                                    _STLP_PRIV __on_right>,
00168                              _STLP_PRIV __on_right> _STLP_CALL
00169 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x,
00170           const _CharT* __s) {
00171   const size_t __n = _Traits::length(__s);
00172   typedef _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __cstr_wrapper<_CharT>,
00173                                                          _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00174                                                          _STLP_PRIV __on_right> __root_type;
00175   __root_type __root(_STLP_PRIV __cstr_wrapper<_CharT>(__s, __n), _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator()));
00176   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00177                                                         __root_type, _STLP_PRIV __on_right>(__x, __root);
00178 }
00179 
00180 template <class _CharT, class _Traits, class _Alloc>
00181 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00182                              _STLP_PRIV __cstr_wrapper<_CharT>,
00183                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00184                                                    _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00185                                                    _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00186                                                    _STLP_PRIV __on_right>,
00187                              _STLP_PRIV __on_right> _STLP_CALL
00188 operator+(const _CharT* __s,
00189           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00190   const size_t __n = _Traits::length(__s);
00191   typedef _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00192                                                          _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00193                                                          _STLP_PRIV __on_right> __root_type;
00194   __root_type __root(__y, _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>(__y.get_allocator()));
00195   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __cstr_wrapper<_CharT>,
00196                                                         __root_type,
00197                                                         _STLP_PRIV __on_right>(_STLP_PRIV __cstr_wrapper<_CharT>(__s, __n), __root);
00198 }
00199 
00200 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00201 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00202                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00203                              _STLP_PRIV __cstr_wrapper<_CharT>,
00204                              _STLP_PRIV __on_left> _STLP_CALL
00205 operator+(const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x,
00206           const _CharT* __s) {
00207   const size_t __n = _Traits::length(__s);
00208   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00209                                                         _STLP_PRIV __cstr_wrapper<_CharT>,
00210                                                         _STLP_PRIV __on_left>(__x, _STLP_PRIV __cstr_wrapper<_CharT>(__s, __n));
00211 }
00212 
00213 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00214 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00215                              _STLP_PRIV __cstr_wrapper<_CharT>,
00216                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00217                              _STLP_PRIV __on_right> _STLP_CALL
00218 operator+(const _CharT* __s,
00219           const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __y) {
00220   const size_t __n = _Traits::length(__s);
00221   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __cstr_wrapper<_CharT>,
00222                                                         _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00223                                                         _STLP_PRIV __on_right>(_STLP_PRIV __cstr_wrapper<_CharT>(__s, __n), __y);
00224 }
00225 
00226 // addition with char
00227 template <class _CharT, class _Traits, class _Alloc>
00228 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00229                              _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00230                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00231                                                    _STLP_PRIV __char_wrapper<_CharT>,
00232                                                    _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00233                                                    _STLP_PRIV __on_right>,
00234                              _STLP_PRIV __on_right> _STLP_CALL
00235 operator+(const basic_string<_CharT,_Traits,_Alloc>& __x, const _CharT __c) {
00236   typedef _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __char_wrapper<_CharT>,
00237                                                          _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00238                                                          _STLP_PRIV __on_right> __root_type;
00239   __root_type __root(__c, _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator()));
00240   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00241                                                         __root_type, _STLP_PRIV __on_right>(__x, __root);
00242 }
00243 
00244 template <class _CharT, class _Traits, class _Alloc>
00245 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00246                              _STLP_PRIV __char_wrapper<_CharT>,
00247                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00248                                                    _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00249                                                    _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00250                                                    _STLP_PRIV __on_right>,
00251                              _STLP_PRIV __on_right> _STLP_CALL
00252 operator+(const _CharT __c, const basic_string<_CharT,_Traits,_Alloc>& __x) {
00253   typedef _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_wrapper<_CharT,_Traits,_Alloc>,
00254                                                          _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>,
00255                                                          _STLP_PRIV __on_right> __root_type;
00256   __root_type __root(__x, _STLP_PRIV __sum_storage_elem<_CharT, _Traits, _Alloc>(__x.get_allocator()));
00257   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __char_wrapper<_CharT>,
00258                                                         __root_type, _STLP_PRIV __on_right>(__c, __root);
00259 }
00260 
00261 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00262 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc,
00263                              _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00264                              _STLP_PRIV __char_wrapper<_CharT>,
00265                              _STLP_PRIV __on_left> _STLP_CALL
00266 operator+(const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x, const _CharT __c) {
00267   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00268                                                         _STLP_PRIV __char_wrapper<_CharT>, _STLP_PRIV __on_left>(__x, __c);
00269 }
00270 
00271 template <class _CharT, class _Traits, class _Alloc, class _Left, class _Right, class _StorageDir>
00272 inline _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __char_wrapper<_CharT>,
00273                                                       _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00274                                                       _STLP_PRIV __on_right> _STLP_CALL
00275 operator+(const _CharT __c, const _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>& __x) {
00276   return _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _STLP_PRIV __char_wrapper<_CharT>,
00277                                                         _STLP_PRIV __bstr_sum<_CharT, _Traits, _Alloc, _Left, _Right, _StorageDir>,
00278                                                         _STLP_PRIV __on_right>(__c, __x);
00279 }
00280 
00281 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00282 
00283 // Operator== and operator!=
00284 
00285 template <class _CharT, class _Traits, class _Alloc>
00286 inline bool _STLP_CALL
00287 operator==(const basic_string<_CharT,_Traits,_Alloc>& __x,
00288            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00289   return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0;
00290 }
00291 
00292 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00293 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00294 inline bool _STLP_CALL
00295 operator==(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00296            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00297   return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0;
00298 }
00299 
00300 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00301 inline bool _STLP_CALL
00302 operator==(const basic_string<_CharT,_Traits,_Alloc>& __x,
00303            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00304   return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0;
00305 }
00306 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00307 
00308 
00309 template <class _CharT, class _Traits, class _Alloc>
00310 inline bool _STLP_CALL
00311 operator==(const _CharT* __s,
00312            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00313   _STLP_FIX_LITERAL_BUG(__s)
00314   size_t __n = _Traits::length(__s);
00315   return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0;
00316 }
00317 
00318 template <class _CharT, class _Traits, class _Alloc>
00319 inline bool _STLP_CALL
00320 operator==(const basic_string<_CharT,_Traits,_Alloc>& __x,
00321            const _CharT* __s) {
00322   _STLP_FIX_LITERAL_BUG(__s)
00323   size_t __n = _Traits::length(__s);
00324   return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0;
00325 }
00326 
00327 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00328 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00329 inline bool _STLP_CALL
00330 operator==(const _CharT* __s,
00331            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00332   _STLP_FIX_LITERAL_BUG(__s)
00333   size_t __n = _Traits::length(__s);
00334   return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0;
00335 }
00336 
00337 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00338 inline bool _STLP_CALL
00339 operator==(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00340            const _CharT* __s) {
00341   _STLP_FIX_LITERAL_BUG(__s)
00342   size_t __n = _Traits::length(__s);
00343   return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0;
00344 }
00345 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00346 
00347 // Operator< (and also >, <=, and >=).
00348 
00349 template <class _CharT, class _Traits, class _Alloc>
00350 inline bool _STLP_CALL
00351 operator<(const basic_string<_CharT,_Traits,_Alloc>& __x,
00352           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00353   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),
00354                                                           __y.begin(), __y.end()) < 0;
00355 }
00356 
00357 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00358 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00359 inline bool _STLP_CALL
00360 operator<(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00361           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00362   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),
00363                                                           __y.begin(), __y.end()) < 0;
00364 }
00365 
00366 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00367 inline bool _STLP_CALL
00368 operator<(const basic_string<_CharT,_Traits,_Alloc>& __x,
00369           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00370   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),
00371                                                           __y.begin(), __y.end()) < 0;
00372 }
00373 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00374 
00375 template <class _CharT, class _Traits, class _Alloc>
00376 inline bool _STLP_CALL
00377 operator<(const _CharT* __s,
00378           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00379   _STLP_FIX_LITERAL_BUG(__s)
00380   size_t __n = _Traits::length(__s);
00381   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n,
00382                                                           __y.begin(), __y.end()) < 0;
00383 }
00384 
00385 template <class _CharT, class _Traits, class _Alloc>
00386 inline bool _STLP_CALL
00387 operator<(const basic_string<_CharT,_Traits,_Alloc>& __x,
00388           const _CharT* __s) {
00389   _STLP_FIX_LITERAL_BUG(__s)
00390   size_t __n = _Traits::length(__s);
00391   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),
00392                                                           __s, __s + __n) < 0;
00393 }
00394 
00395 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00396 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00397 inline bool _STLP_CALL
00398 operator<(const _CharT* __s,
00399           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00400   _STLP_FIX_LITERAL_BUG(__s)
00401   size_t __n = _Traits::length(__s);
00402   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n,
00403                                                           __y.begin(), __y.end()) < 0;
00404 }
00405 
00406 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00407 inline bool _STLP_CALL
00408 operator<(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00409           const _CharT* __s) {
00410   _STLP_FIX_LITERAL_BUG(__s)
00411   size_t __n = _Traits::length(__s);
00412   return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),
00413                                                           __s, __s + __n) < 0;
00414 }
00415 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00416 
00417 #if defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE)
00418 
00419 /* Only defined if _STLP_USE_SEPARATE_RELOPS_NAMESPACE is defined otherwise
00420  * it might introduce ambiguity with pure template relational operators
00421  * from rel_ops namespace.
00422  */
00423 template <class _CharT, class _Traits, class _Alloc>
00424 inline bool _STLP_CALL
00425 operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00426            const basic_string<_CharT,_Traits,_Alloc>& __y)
00427 { return !(__x == __y); }
00428 
00429 template <class _CharT, class _Traits, class _Alloc>
00430 inline bool _STLP_CALL
00431 operator>(const basic_string<_CharT,_Traits,_Alloc>& __x,
00432           const basic_string<_CharT,_Traits,_Alloc>& __y)
00433 { return __y < __x; }
00434 
00435 template <class _CharT, class _Traits, class _Alloc>
00436 inline bool _STLP_CALL
00437 operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00438            const basic_string<_CharT,_Traits,_Alloc>& __y)
00439 { return !(__y < __x); }
00440 
00441 template <class _CharT, class _Traits, class _Alloc>
00442 inline bool _STLP_CALL
00443 operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00444            const basic_string<_CharT,_Traits,_Alloc>& __y)
00445 { return !(__x < __y); }
00446 
00447 #  if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00448 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00449 inline bool _STLP_CALL
00450 operator!=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00451            const basic_string<_CharT,_Traits,_Alloc>& __y)
00452 { return !(__x==__y); }
00453 
00454 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00455 inline bool _STLP_CALL
00456 operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00457            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y)
00458 { return !(__x==__y); }
00459 #  endif
00460 
00461 #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
00462 
00463 template <class _CharT, class _Traits, class _Alloc>
00464 inline bool _STLP_CALL
00465 operator!=(const _CharT* __s,
00466            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00467   _STLP_FIX_LITERAL_BUG(__s)
00468   return !(__s == __y);
00469 }
00470 
00471 template <class _CharT, class _Traits, class _Alloc>
00472 inline bool _STLP_CALL
00473 operator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00474            const _CharT* __s) {
00475   _STLP_FIX_LITERAL_BUG(__s)
00476   return !(__x == __s);
00477 }
00478 
00479 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00480 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00481 inline bool _STLP_CALL
00482 operator!=(const _CharT* __s,
00483            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00484   _STLP_FIX_LITERAL_BUG(__s)
00485   return !(__s == __y);
00486 }
00487 
00488 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00489 inline bool _STLP_CALL
00490 operator!=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00491            const _CharT* __s) {
00492   _STLP_FIX_LITERAL_BUG(__s)
00493   return !(__x == __s);
00494 }
00495 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00496 
00497 template <class _CharT, class _Traits, class _Alloc>
00498 inline bool _STLP_CALL
00499 operator>(const _CharT* __s,
00500           const basic_string<_CharT,_Traits,_Alloc>& __y) {
00501   _STLP_FIX_LITERAL_BUG(__s)
00502   return __y < __s;
00503 }
00504 
00505 template <class _CharT, class _Traits, class _Alloc>
00506 inline bool _STLP_CALL
00507 operator>(const basic_string<_CharT,_Traits,_Alloc>& __x,
00508           const _CharT* __s) {
00509   _STLP_FIX_LITERAL_BUG(__s)
00510   return __s < __x;
00511 }
00512 
00513 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00514 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00515 inline bool _STLP_CALL
00516 operator>(const _CharT* __s,
00517           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00518   _STLP_FIX_LITERAL_BUG(__s)
00519   return __y < __s;
00520 }
00521 
00522 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00523 inline bool _STLP_CALL
00524 operator>(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00525           const _CharT* __s) {
00526   _STLP_FIX_LITERAL_BUG(__s)
00527   return __s < __x;
00528 }
00529 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00530 
00531 template <class _CharT, class _Traits, class _Alloc>
00532 inline bool _STLP_CALL
00533 operator<=(const _CharT* __s,
00534            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00535   _STLP_FIX_LITERAL_BUG(__s)
00536   return !(__y < __s);
00537 }
00538 
00539 template <class _CharT, class _Traits, class _Alloc>
00540 inline bool _STLP_CALL
00541 operator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00542            const _CharT* __s) {
00543   _STLP_FIX_LITERAL_BUG(__s)
00544   return !(__s < __x);
00545 }
00546 
00547 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00548 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00549 inline bool _STLP_CALL
00550 operator<=(const _CharT* __s,
00551            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00552   _STLP_FIX_LITERAL_BUG(__s)
00553   return !(__y < __s);
00554 }
00555 
00556 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00557 inline bool _STLP_CALL
00558 operator<=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00559            const _CharT* __s) {
00560   _STLP_FIX_LITERAL_BUG(__s)
00561   return !(__s < __x);
00562 }
00563 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00564 
00565 template <class _CharT, class _Traits, class _Alloc>
00566 inline bool _STLP_CALL
00567 operator>=(const _CharT* __s,
00568            const basic_string<_CharT,_Traits,_Alloc>& __y) {
00569   _STLP_FIX_LITERAL_BUG(__s)
00570   return !(__s < __y);
00571 }
00572 
00573 template <class _CharT, class _Traits, class _Alloc>
00574 inline bool _STLP_CALL
00575 operator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,
00576            const _CharT* __s) {
00577   _STLP_FIX_LITERAL_BUG(__s)
00578   return !(__x < __s);
00579 }
00580 
00581 #if defined (_STLP_USE_TEMPLATE_EXPRESSION)
00582 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00583 inline bool _STLP_CALL
00584 operator>=(const _CharT* __s,
00585            const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {
00586   _STLP_FIX_LITERAL_BUG(__s)
00587   return !(__s < __y);
00588 }
00589 
00590 template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>
00591 inline bool _STLP_CALL
00592 operator>=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,
00593            const _CharT* __s) {
00594   _STLP_FIX_LITERAL_BUG(__s)
00595   return !(__x < __s);
00596 }
00597 #endif /* _STLP_USE_TEMPLATE_EXPRESSION */
00598 
00599 _STLP_END_NAMESPACE
00600 
00601 #endif /* _STLP_STRING_OPERATORS_H */
00602 



Generated on Mon Mar 10 15:32:40 2008 by  doxygen 1.5.1