Install gcc-4.4.0-tdm-1-core-2.tar.gz
[msysgit.git] / mingw / lib / gcc / mingw32 / 4.3.3 / include / c++ / bits / stl_raw_storage_iter.h
blob08e6c58f6b41a818853bd76bfc644ff6ed187562
1 // -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
20 // USA.
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
33 * Copyright (c) 1994
34 * Hewlett-Packard Company
36 * Permission to use, copy, modify, distribute and sell this software
37 * and its documentation for any purpose is hereby granted without fee,
38 * provided that the above copyright notice appear in all copies and
39 * that both that copyright notice and this permission notice appear
40 * in supporting documentation. Hewlett-Packard Company makes no
41 * representations about the suitability of this software for any
42 * purpose. It is provided "as is" without express or implied warranty.
45 * Copyright (c) 1996
46 * Silicon Graphics Computer Systems, Inc.
48 * Permission to use, copy, modify, distribute and sell this software
49 * and its documentation for any purpose is hereby granted without fee,
50 * provided that the above copyright notice appear in all copies and
51 * that both that copyright notice and this permission notice appear
52 * in supporting documentation. Silicon Graphics makes no
53 * representations about the suitability of this software for any
54 * purpose. It is provided "as is" without express or implied warranty.
57 /** @file stl_raw_storage_iter.h
58 * This is an internal header file, included by other library headers.
59 * You should not attempt to use it directly.
62 #ifndef _STL_RAW_STORAGE_ITERATOR_H
63 #define _STL_RAW_STORAGE_ITERATOR_H 1
65 _GLIBCXX_BEGIN_NAMESPACE(std)
67 /**
68 * This iterator class lets algorithms store their results into
69 * uninitialized memory.
71 template <class _OutputIterator, class _Tp>
72 class raw_storage_iterator
73 : public iterator<output_iterator_tag, void, void, void, void>
75 protected:
76 _OutputIterator _M_iter;
78 public:
79 explicit
80 raw_storage_iterator(_OutputIterator __x)
81 : _M_iter(__x) {}
83 raw_storage_iterator&
84 operator*() { return *this; }
86 raw_storage_iterator&
87 operator=(const _Tp& __element)
89 std::_Construct(&*_M_iter, __element);
90 return *this;
93 raw_storage_iterator<_OutputIterator, _Tp>&
94 operator++()
96 ++_M_iter;
97 return *this;
100 raw_storage_iterator<_OutputIterator, _Tp>
101 operator++(int)
103 raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
104 ++_M_iter;
105 return __tmp;
109 _GLIBCXX_END_NAMESPACE
111 #endif