_string_operators.h

来自「stl的源码」· C头文件 代码 · 共 603 行 · 第 1/2 页

H
603
字号
           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  return __x.size() == __y.size() && _Traits::compare(__x.data(), __y.data(), __x.size()) == 0;}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator==(const _CharT* __s,           const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0;}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator==(const basic_string<_CharT,_Traits,_Alloc>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0;}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator==(const _CharT* __s,           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return __n == __y.size() && _Traits::compare(__s, __y.data(), __n) == 0;}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator==(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return __x.size() == __n && _Traits::compare(__x.data(), __s, __n) == 0;}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */// Operator< (and also >, <=, and >=).template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<(const basic_string<_CharT,_Traits,_Alloc>& __x,          const basic_string<_CharT,_Traits,_Alloc>& __y) {  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),                                                          __y.begin(), __y.end()) < 0;}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,          const basic_string<_CharT,_Traits,_Alloc>& __y) {  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),                                                          __y.begin(), __y.end()) < 0;}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<(const basic_string<_CharT,_Traits,_Alloc>& __x,          const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),                                                          __y.begin(), __y.end()) < 0;}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<(const _CharT* __s,          const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n,                                                          __y.begin(), __y.end()) < 0;}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<(const basic_string<_CharT,_Traits,_Alloc>& __x,          const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),                                                          __s, __s + __n) < 0;}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<(const _CharT* __s,          const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__s, __s + __n,                                                          __y.begin(), __y.end()) < 0;}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,          const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  size_t __n = _Traits::length(__s);  return basic_string<_CharT,_Traits,_Alloc> ::_M_compare(__x.begin(), __x.end(),                                                          __s, __s + __n) < 0;}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */#if defined (_STLP_USE_SEPARATE_RELOPS_NAMESPACE)/* Only defined if _STLP_USE_SEPARATE_RELOPS_NAMESPACE is defined otherwise * it might introduce ambiguity with pure template relational operators * from rel_ops namespace. */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const basic_string<_CharT,_Traits,_Alloc>& __y){ return !(__x == __y); }template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>(const basic_string<_CharT,_Traits,_Alloc>& __x,          const basic_string<_CharT,_Traits,_Alloc>& __y){ return __y < __x; }template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const basic_string<_CharT,_Traits,_Alloc>& __y){ return !(__y < __x); }template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const basic_string<_CharT,_Traits,_Alloc>& __y){ return !(__x < __y); }#  if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator!=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,           const basic_string<_CharT,_Traits,_Alloc>& __y){ return !(__x==__y); }template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y){ return !(__x==__y); }#  endif#endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator!=(const _CharT* __s,           const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s == __y);}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator!=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__x == __s);}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator!=(const _CharT* __s,           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s == __y);}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator!=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__x == __s);}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>(const _CharT* __s,          const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return __y < __s;}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>(const basic_string<_CharT,_Traits,_Alloc>& __x,          const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return __s < __x;}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator>(const _CharT* __s,          const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return __y < __s;}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator>(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,          const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return __s < __x;}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<=(const _CharT* __s,           const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__y < __s);}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator<=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s < __x);}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<=(const _CharT* __s,           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__y < __s);}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator<=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s < __x);}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>=(const _CharT* __s,           const basic_string<_CharT,_Traits,_Alloc>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s < __y);}template <class _CharT, class _Traits, class _Alloc>inline bool _STLP_CALLoperator>=(const basic_string<_CharT,_Traits,_Alloc>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__x < __s);}#if defined (_STLP_USE_TEMPLATE_EXPRESSION)template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator>=(const _CharT* __s,           const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __y) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__s < __y);}template <class _CharT, class _Traits, class _Alloc, class _Lhs, class _Rhs, class _StoreDir>inline bool _STLP_CALLoperator>=(const _STLP_PRIV __bstr_sum<_CharT,_Traits,_Alloc,_Lhs,_Rhs,_StoreDir>& __x,           const _CharT* __s) {  _STLP_FIX_LITERAL_BUG(__s)  return !(__x < __s);}#endif /* _STLP_USE_TEMPLATE_EXPRESSION */_STLP_END_NAMESPACE#endif /* _STLP_STRING_OPERATORS_H */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?