* include/c/bits/std_cctype.h: Undefine macros that conflict
[official-gcc.git] / libstdc++ / stl / stl_raw_storage_iter.h
blob6f3951cb8af83b43443c3804484e6755415c8c76
1 /*
3 * Copyright (c) 1994
4 * Hewlett-Packard Company
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.
15 * Copyright (c) 1996
16 * Silicon Graphics Computer Systems, Inc.
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.
27 /* NOTE: This is an internal header file, included by other STL headers.
28 * You should not attempt to use it directly.
31 #ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
32 #define __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
34 __STL_BEGIN_NAMESPACE
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;
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;
53 raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
54 ++_M_iter;
55 return *this;
57 raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
58 raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
59 ++_M_iter;
60 return __tmp;
64 #ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
66 template <class _ForwardIterator, class _Tp>
67 inline output_iterator_tag
68 iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&)
70 return output_iterator_tag();
73 #endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
75 __STL_END_NAMESPACE
77 #endif /* __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H */
79 // Local Variables:
80 // mode:C++
81 // End: