stl_raw_storage_iter.h

00001 /*
00002  *
00003  * Copyright (c) 1994
00004  * Hewlett-Packard Company
00005  *
00006  * Permission to use, copy, modify, distribute and sell this software
00007  * and its documentation for any purpose is hereby granted without fee,
00008  * provided that the above copyright notice appear in all copies and
00009  * that both that copyright notice and this permission notice appear
00010  * in supporting documentation.  Hewlett-Packard Company makes no
00011  * representations about the suitability of this software for any
00012  * purpose.  It is provided "as is" without express or implied warranty.
00013  *
00014  *
00015  * Copyright (c) 1996
00016  * Silicon Graphics Computer Systems, Inc.
00017  *
00018  * Permission to use, copy, modify, distribute and sell this software
00019  * and its documentation for any purpose is hereby granted without fee,
00020  * provided that the above copyright notice appear in all copies and
00021  * that both that copyright notice and this permission notice appear
00022  * in supporting documentation.  Silicon Graphics makes no
00023  * representations about the suitability of this software for any
00024  * purpose.  It is provided "as is" without express or implied warranty.
00025  */
00026 
00027 /* NOTE: This is an internal header file, included by other STL headers.
00028  * You should not attempt to use it directly.
00029  */
00030 
00031 #ifndef __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
00032 #define __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H
00033 
00034 __STL_BEGIN_NAMESPACE
00035 
00036 template <class _ForwardIterator, class _Tp>
00037 class raw_storage_iterator {
00038 protected:
00039   _ForwardIterator _M_iter;
00040 public:
00041   typedef output_iterator_tag iterator_category;
00042   typedef void                value_type;
00043   typedef void                difference_type;
00044   typedef void                pointer;
00045   typedef void                reference;
00046 
00047   explicit raw_storage_iterator(_ForwardIterator __x) : _M_iter(__x) {}
00048   raw_storage_iterator& operator*() { return *this; }
00049   raw_storage_iterator& operator=(const _Tp& __element) {
00050     construct(&*_M_iter, __element);
00051     return *this;
00052   }        
00053   raw_storage_iterator<_ForwardIterator, _Tp>& operator++() {
00054     ++_M_iter;
00055     return *this;
00056   }
00057   raw_storage_iterator<_ForwardIterator, _Tp> operator++(int) {
00058     raw_storage_iterator<_ForwardIterator, _Tp> __tmp = *this;
00059     ++_M_iter;
00060     return __tmp;
00061   }
00062 };
00063 
00064 #ifndef __STL_CLASS_PARTIAL_SPECIALIZATION
00065 
00066 template <class _ForwardIterator, class _Tp>
00067 inline output_iterator_tag
00068 iterator_category(const raw_storage_iterator<_ForwardIterator, _Tp>&)
00069 {
00070   return output_iterator_tag();
00071 }
00072 
00073 #endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */
00074 
00075 __STL_END_NAMESPACE
00076 
00077 #endif /* __SGI_STL_INTERNAL_RAW_STORAGE_ITERATOR_H */
00078 
00079 // Local Variables:
00080 // mode:C++
00081 // End:

Generated on Mon Jun 5 10:20:44 2006 for Intelligence.kdevelop by  doxygen 1.4.6