OSDN Git Service

2001-06-18 Benjamin Kosnik <bkoz@redhat.com>
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / include / bits / stl_raw_storage_iter.h
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 namespace std
35 {
36   template <class _ForwardIterator, class _Tp>
37   class raw_storage_iterator 
38     : public iterator<output_iterator_tag, void, void, void, void>
39     {
40     protected:
41       _ForwardIterator _M_iter;
42
43     public:
44       explicit 
45       raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
46
47       raw_storage_iterator& 
48       operator*() { return *this; }
49
50       raw_storage_iterator& 
51       operator=(const _Tp& __element) 
52       {
53         construct(&*_M_iter, __element);
54         return *this;
55       }        
56
57       raw_storage_iterator<_ForwardIterator, _Tp>& 
58       operator++() 
59       {
60         ++_M_iter;
61         return *this;
62       }
63
64       raw_storage_iterator<_ForwardIterator, _Tp> 
65       operator++(int) 
66       {
67         raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
68         ++_M_iter;
69         return __tmp;
70       }
71     };
72 } // namespace std
73
74 #endif
75
76 // Local Variables:
77 // mode:C++
78 // End: