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 / _slist.h < prev    next >
C/C++ Source or Header  |  2001-11-14  |  2KB  |  84 lines

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