home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / stl / _set_operators.h < prev    next >
C/C++ Source or Header  |  2001-01-26  |  2KB  |  55 lines

  1. // This is an implementation file which
  2. // is intended to be included multiple times with different _STLP_ASSOCIATIVE_CONTAINER
  3. // setting
  4.  
  5. template <class _Key, class _Compare, class _Alloc>
  6. inline bool _STLP_CALL operator==(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  7.                        const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  8.   return __x.size() == __y.size() &&
  9.     equal(__x.begin(), __x.end(), __y.begin());
  10. }
  11.  
  12. template <class _Key, class _Compare, class _Alloc>
  13. inline bool _STLP_CALL operator<(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  14.                       const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  15.   return lexicographical_compare(__x.begin(), __x.end(), 
  16.                  __y.begin(), __y.end());
  17. }
  18.  
  19. #ifdef _STLP_USE_SEPARATE_RELOPS_NAMESPACE
  20.  
  21. template <class _Key, class _Compare, class _Alloc>
  22. inline bool _STLP_CALL operator!=(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  23.                        const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  24.   return !(__x == __y);
  25. }
  26.  
  27. template <class _Key, class _Compare, class _Alloc>
  28. inline bool _STLP_CALL operator>(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  29.                       const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  30.   return __y < __x;
  31. }
  32.  
  33. template <class _Key, class _Compare, class _Alloc>
  34. inline bool _STLP_CALL operator<=(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  35.                        const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  36.   return !(__y < __x);
  37. }
  38.  
  39. template <class _Key, class _Compare, class _Alloc>
  40. inline bool _STLP_CALL operator>=(const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  41.                        const _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  42.   return !(__x < __y);
  43. }
  44. #endif /* _STLP_USE_SEPARATE_RELOPS_NAMESPACE */
  45.  
  46. #ifdef _STLP_FUNCTION_TMPL_PARTIAL_ORDER
  47.  
  48. template <class _Key, class _Compare, class _Alloc>
  49. inline void _STLP_CALL swap(_STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __x, 
  50.                  _STLP_SET_FLAVOR<_Key,_Compare,_Alloc>& __y) {
  51.   __x.swap(__y);
  52. }
  53.  
  54. #endif /* _STLP_FUNCTION_TMPL_PARTIAL_ORDER */
  55.