STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
stl_raw_storage_iter.h File Reference

Go to the source code of this file.

Functions

namespace std _GLIBCXX_VISIBILITY (default)
 

Detailed Description

This is an internal header file, included by other library headers. Do not attempt to use it directly. {memory}

Function Documentation

namespace std _GLIBCXX_VISIBILITY ( default  )

This iterator class lets algorithms store their results into uninitialized memory.

60 {
61 _GLIBCXX_BEGIN_NAMESPACE_VERSION
62 
67  template <class _OutputIterator, class _Tp>
68  class raw_storage_iterator
69  : public iterator<output_iterator_tag, void, void, void, void>
70  {
71  protected:
72  _OutputIterator _M_iter;
73 
74  public:
75  explicit
76  raw_storage_iterator(_OutputIterator __x)
77  : _M_iter(__x) {}
78 
79  raw_storage_iterator&
80  operator*() { return *this; }
81 
82  raw_storage_iterator&
83  operator=(const _Tp& __element)
84  {
85  std::_Construct(std::__addressof(*_M_iter), __element);
86  return *this;
87  }
88 
89  raw_storage_iterator<_OutputIterator, _Tp>&
90  operator++()
91  {
92  ++_M_iter;
93  return *this;
94  }
95 
96  raw_storage_iterator<_OutputIterator, _Tp>
97  operator++(int)
98  {
99  raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
100  ++_M_iter;
101  return __tmp;
102  }
103  };
104 
105 _GLIBCXX_END_NAMESPACE_VERSION
106 } // namespace