]>
Commit | Line | Data |
---|---|---|
725dc051 BK |
1 | /* |
2 | * | |
3 | * Copyright (c) 1994 | |
4 | * Hewlett-Packard Company | |
5 | * | |
6 | * Permission to use, copy, modify, distribute and sell this software | |
7 | * and its documentation for any purpose is hereby granted without fee, | |
8 | * provided that the above copyright notice appear in all copies and | |
9 | * that both that copyright notice and this permission notice appear | |
10 | * in supporting documentation. Hewlett-Packard Company makes no | |
11 | * representations about the suitability of this software for any | |
12 | * purpose. It is provided "as is" without express or implied warranty. | |
13 | * | |
14 | * | |
15 | * Copyright (c) 1996 | |
16 | * Silicon Graphics Computer Systems, Inc. | |
17 | * | |
18 | * Permission to use, copy, modify, distribute and sell this software | |
19 | * and its documentation for any purpose is hereby granted without fee, | |
20 | * provided that the above copyright notice appear in all copies and | |
21 | * that both that copyright notice and this permission notice appear | |
22 | * in supporting documentation. Silicon Graphics makes no | |
23 | * representations about the suitability of this software for any | |
24 | * purpose. It is provided "as is" without express or implied warranty. | |
25 | */ | |
26 | ||
27 | /* NOTE: This is an internal header file, included by other STL headers. | |
28 | * You should not attempt to use it directly. | |
29 | */ | |
30 | ||
31 | #ifndef _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H | |
32 | #define _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H 1 | |
33 | ||
34 | __STL_BEGIN_NAMESPACE | |
35 | ||
36 | template <class _ForwardIterator, class _Tp> | |
37 | class raw_storage_iterator { | |
38 | protected: | |
39 | _ForwardIterator _M_iter; | |
40 | public: | |
41 | typedef output_iterator_tag iterator_category; | |
42 | typedef void value_type; | |
43 | typedef void difference_type; | |
44 | typedef void pointer; | |
45 | typedef void reference; | |
46 | ||
47 | explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {} | |
48 | raw_storage_iterator& operator*() { return *this; } | |
49 | raw_storage_iterator& operator=(const _Tp& __element) { | |
50 | construct(&*_M_iter, __element); | |
51 | return *this; | |
52 | } | |
53 | raw_storage_iterator<_ForwardIterator, _Tp>& operator++() { | |
54 | ++_M_iter; | |
55 | return *this; | |
56 | } | |
57 | raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) { | |
58 | raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this; | |
59 | ++_M_iter; | |
60 | return __tmp; | |
61 | } | |
62 | }; | |
63 | ||
64 | #ifndef __STL_CLASS_PARTIAL_SPECIALIZATION | |
65 | ||
66 | template <class _ForwardIterator, class _Tp> | |
67 | inline output_iterator_tag | |
68 | iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&) | |
69 | { | |
70 | return output_iterator_tag(); | |
71 | } | |
72 | ||
73 | #endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */ | |
74 | ||
75 | __STL_END_NAMESPACE | |
76 | ||
77 | #endif /* _CPP_BITS_STL_RAW_STORAGE_ITERATOR_H */ | |
78 | ||
79 | // Local Variables: | |
80 | // mode:C++ | |
81 | // End: |