tmp/tmpio0j857l/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="ostream.iterator.general">[[ostream.iterator.general]]</a>
|
| 2 |
+
|
| 3 |
+
`ostream_iterator` writes (using `operator<<`) successive elements onto
|
| 4 |
+
the output stream from which it was constructed. If it was constructed
|
| 5 |
+
with `charT*` as a constructor argument, this string, called a
|
| 6 |
+
*delimiter string*, is written to the stream after every `T` is written.
|
| 7 |
+
|
| 8 |
+
``` cpp
|
| 9 |
+
namespace std {
|
| 10 |
+
template<class T, class charT = char, class traits = char_traits<charT>>
|
| 11 |
+
class ostream_iterator {
|
| 12 |
+
public:
|
| 13 |
+
using iterator_category = output_iterator_tag;
|
| 14 |
+
using value_type = void;
|
| 15 |
+
using difference_type = ptrdiff_t;
|
| 16 |
+
using pointer = void;
|
| 17 |
+
using reference = void;
|
| 18 |
+
using char_type = charT;
|
| 19 |
+
using traits_type = traits;
|
| 20 |
+
using ostream_type = basic_ostream<charT,traits>;
|
| 21 |
+
|
| 22 |
+
ostream_iterator(ostream_type& s);
|
| 23 |
+
ostream_iterator(ostream_type& s, const charT* delimiter);
|
| 24 |
+
ostream_iterator(const ostream_iterator& x);
|
| 25 |
+
~ostream_iterator();
|
| 26 |
+
ostream_iterator& operator=(const ostream_iterator&) = default;
|
| 27 |
+
ostream_iterator& operator=(const T& value);
|
| 28 |
+
|
| 29 |
+
ostream_iterator& operator*();
|
| 30 |
+
ostream_iterator& operator++();
|
| 31 |
+
ostream_iterator& operator++(int);
|
| 32 |
+
|
| 33 |
+
private:
|
| 34 |
+
basic_ostream<charT,traits>* out_stream; // exposition only
|
| 35 |
+
const charT* delim; // exposition only
|
| 36 |
+
};
|
| 37 |
+
}
|
| 38 |
+
```
|
| 39 |
+
|