home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / stl / wrappers / _vector.h < prev   
C/C++ Source or Header  |  2001-11-14  |  2KB  |  90 lines

  1. /*
  2.  *
  3.  * Copyright (c) 1994
  4.  * Hewlett-Packard Company
  5.  *
  6.  * Copyright (c) 1996,1997
  7.  * Silicon Graphics Computer Systems, Inc.
  8.  *
  9.  * Copyright (c) 1997
  10.  * Moscow Center for SPARC Technology
  11.  *
  12.  * Copyright (c) 1999 
  13.  * Boris Fomitchev
  14.  *
  15.  * This material is provided "as is", with absolutely no warranty expressed
  16.  * or implied. Any use is at your own risk.
  17.  *
  18.  * Permission to use or copy this software for any purpose is hereby granted 
  19.  * without fee, provided the above notices are retained on all copies.
  20.  * Permission to modify the code and to distribute modified code is granted,
  21.  * provided the above notices are retained, and a notice that the code was
  22.  * modified is included with the above copyright notice.
  23.  *
  24.  */
  25.  
  26. /* NOTE: This is an internal header file, included by other STL headers.
  27.  *   You should not attempt to use it directly.
  28.  */
  29.  
  30. #ifndef _STLP_INTERNAL_WRAP_VECTOR_H
  31. #define _STLP_INTERNAL_WRAP_VECTOR_H
  32.  
  33. #ifndef _STLP_INTERNAL_VECTOR_H
  34. # include <stl/_vector.h>
  35. #endif
  36.  
  37. # if defined (_STLP_DEBUG)
  38. #  define _VEC_SUPER _DBG_vector<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
  39. # else
  40. #  define _VEC_SUPER __vector__<_Tp, _STLP_DEFAULT_ALLOCATOR(_Tp) >
  41. # endif
  42.  
  43. # ifdef _STLP_USE_NAMESPACES
  44. namespace STLPORT { 
  45. # endif
  46.  
  47. template <class _Tp>
  48. class vector : public _VEC_SUPER
  49. {
  50. public:
  51.     typedef _VEC_SUPER  _Super;
  52.     __IMPORT_WITH_REVERSE_ITERATORS(_Super)
  53.     __IMPORT_SUPER_COPY_ASSIGNMENT(vector, vector<_Tp>, _VEC_SUPER)
  54.     vector() {}
  55.     explicit vector(size_type __n, const _Tp& __value) : _VEC_SUPER(__n, __value) { }
  56.     explicit vector(size_type __n) : _VEC_SUPER(__n) { }
  57.     vector(const_iterator __first, const_iterator __last) : _VEC_SUPER(__first,__last) { }
  58. # ifdef _STLP_DEBUG
  59.   // certainly, no member templates here !
  60.     vector(const _Tp* __first, const _Tp* __last) : _VEC_SUPER(__first,__last) { }    
  61. # endif
  62.     ~vector() {}
  63. };
  64.  
  65. #  if defined (_STLP_BASE_MATCH_BUG)
  66. template <class _Tp>
  67. inline bool operator==(const vector<_Tp>& __x, const vector<_Tp>& __y) {
  68.   return __x.size() == __y.size() &&
  69.     equal(__x.begin(), __x.end(), __y.begin());
  70. }
  71.  
  72. template <class _Tp>
  73. inline bool operator<(const vector<_Tp>& __x, const vector<_Tp>& __y) {
  74.   return lexicographical_compare(__x.begin(), __x.end(), 
  75.                  __y.begin(), __y.end());
  76. }
  77. #  endif /* _STLP_BASE_MATCH_BUG */
  78. #  undef _VEC_SUPER
  79.  
  80. // close std namespace
  81. # ifdef _STLP_USE_NAMESPACES
  82. }
  83. # endif
  84.  
  85. #endif /* _STLP_WRAP_VECTOR_H */
  86.  
  87. // Local Variables:
  88. // mode:C++
  89. // End:
  90.