home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / stlpt453.zip / STLport-4.5.3 / stlport / stl / _raw_storage_iter.h < prev    next >
C/C++ Source or Header  |  2001-01-26  |  2KB  |  83 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_RAW_STORAGE_ITERATOR_H
  31. #define _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H
  32.  
  33. #ifndef _STLP_INTERNAL_ITERATOR_BASE_H
  34. #  include <stl/_iterator_base.h>
  35. #endif
  36.  
  37. _STLP_BEGIN_NAMESPACE
  38.  
  39. template <class _ForwardIterator, class _Tp>
  40. class raw_storage_iterator 
  41. # ifdef _STLP_HAS_VOID_SPECIALIZATION
  42.       : public iterator<output_iterator_tag,void,void,void,void> {
  43. # endif
  44. {
  45. protected:
  46.   _ForwardIterator _M_iter;
  47. public:
  48.   typedef output_iterator_tag iterator_category;
  49. # ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION
  50.   typedef void                value_type;
  51.   typedef void                difference_type;
  52.   typedef void                pointer;
  53.   typedef void                reference;
  54. # endif
  55.   explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
  56.   raw_storage_iterator<_ForwardIterator, _Tp>& operator*() { return *this; }
  57.   raw_storage_iterator<_ForwardIterator, _Tp>& operator=(const _Tp& __element) {
  58.     _Construct(&*_M_iter, __element);
  59.     return *this;
  60.   }        
  61.   raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
  62.     ++_M_iter;
  63.     return *this;
  64.   }
  65.   raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
  66.     raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
  67.     ++_M_iter;
  68.     return __tmp;
  69.   }
  70. };
  71.  
  72. # ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES
  73. template <class _ForwardIterator, class _Tp>
  74. inline output_iterator_tag iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&) { return output_iterator_tag(); }
  75. #endif
  76. _STLP_END_NAMESPACE
  77.  
  78. #endif /* _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H */
  79.  
  80. // Local Variables:
  81. // mode:C++
  82. // End:
  83.