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 : public iterator<output_iterator_tag,void,void,void,void>
42 {
43 protected:
44 _ForwardIterator _M_iter;
45 public:
46 typedef output_iterator_tag iterator_category;
47 # ifdef _STLP_CLASS_PARTIAL_SPECIALIZATION
48 typedef void value_type;
49 typedef void difference_type;
50 typedef void pointer;
51 typedef void reference;
52 # endif
raw_storage_iterator(_ForwardIterator __x)53 explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
54 raw_storage_iterator<_ForwardIterator, _Tp>& operator*() { return *this; }
55 raw_storage_iterator<_ForwardIterator, _Tp>& operator=(const _Tp& __element) {
56 _Param_Construct(&*_M_iter, __element);
57 return *this;
58 }
59 raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
60 ++_M_iter;
61 return *this;
62 }
63 raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
64 raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
65 ++_M_iter;
66 return __tmp;
67 }
68 };
69
70 # ifdef _STLP_USE_OLD_HP_ITERATOR_QUERIES
71 template <class _ForwardIterator, class _Tp>
iterator_category(const raw_storage_iterator<_ForwardIterator,_Tp> &)72 inline output_iterator_tag iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&) { return output_iterator_tag(); }
73 #endif
74 _STLP_END_NAMESPACE
75
76 #endif /* _STLP_INTERNAL_RAW_STORAGE_ITERATOR_H */
77
78 // Local Variables:
79 // mode:C++
80 // End:
81