diff options
author | Nicolas Guillemot <nguillemot@apple.com> | 2021-03-04 09:58:16 -0800 |
---|---|---|
committer | Nicolas Guillemot <nguillemot@apple.com> | 2021-03-04 11:12:48 -0800 |
commit | 7479a2e00bc41f399942e5106fbdf9b4b0c11506 (patch) | |
tree | 662139a7f6851cb433c851f88ad32bff86ebda68 /clang/lib/CodeGen/CodeGenModule.h | |
parent | d268febc5610021af41b9dde5762404d09509f30 (diff) | |
download | llvm-7479a2e00bc41f399942e5106fbdf9b4b0c11506.zip llvm-7479a2e00bc41f399942e5106fbdf9b4b0c11506.tar.gz llvm-7479a2e00bc41f399942e5106fbdf9b4b0c11506.tar.bz2 |
[Support] Add raw_ostream_iterator: ostream_iterator for raw_ostream
Adds a class `raw_ostream_iterator` that behaves like
std::ostream_iterator, but can be used with raw_ostream.
This is useful for using raw_ostream with std algorithms.
For example, it can be used to output std containers as follows:
```
std::vector<int> V = { 1, 2, 3 };
std::copy(V.begin(), V.end(), raw_ostream_iterator<int>(outs(), ", "));
// Output: "1, 2, 3, "
```
The API tries to follow std::ostream_iterator as closely as is
practically possible.
Reviewed By: dblaikie, mkitzan
Differential Revision: https://reviews.llvm.org/D78795
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions