HomePhabricator

Implement LWG#1203 for raw_ostream.

Authored by csigg on Dec 9 2019, 1:32 PM.

Description

Implement LWG#1203 for raw_ostream.

Implement LWG#1203 (https://cplusplus.github.io/LWG/issue1203) for raw_ostream
like libc++ does for std::basic_ostream<...>.

Add a operator<< overload that takes an rvalue reference of a typed derived from
raw_ostream, streams the value to it and returns the stream of the same type as
the argument.

This allows free operator<< to work with rvalue reference raw_ostreams:
raw_ostream& operator<<(raw_ostream&, const SomeType& Value);
raw_os_ostream(std::cout) << SomeType();

It also allows using the derived type like:
auto Foo = (raw_string_ostream(buffer) << "foo").str();

Author: Christian Sigg <csigg@google.com>
Differential Revision: https://reviews.llvm.org/D70686

Details

Committed
traDec 9 2019, 2:00 PM
Differential Revision
D70686: Implement LWG#1203 for raw_ostream
Parents
rG9ef451d1fdaa: [hwasan] Offline symbolization script.
Branches
Unknown
Tags
Unknown