rename standard streams to feel less keywordy

master
Daniel Kolesa 2017-03-04 15:41:14 +01:00
parent 3c33395fe6
commit 60cc9ee47e
2 changed files with 6 additions and 6 deletions

View File

@ -137,7 +137,7 @@ int main() {
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF
);
std::locale::global(std::locale{""});
out.imbue(std::locale{});
cout.imbue(std::locale{});
writefln("\n-- number format with system locale --");
writefln(
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF

View File

@ -168,9 +168,9 @@ inline void swap(file_stream &a, file_stream &b) {
a.swap(b);
}
static file_stream in(stdin);
static file_stream out(stdout);
static file_stream err(stderr);
static file_stream cin{stdin};
static file_stream cout{stdout};
static file_stream cerr{stderr};
/* no need to call anything from file_stream, prefer simple calls... */
@ -209,7 +209,7 @@ namespace detail {
template<typename ...A>
inline void write(A const &...args) {
format_spec sp{'s', out.getloc()};
format_spec sp{'s', cout.getloc()};
(sp.format_value(detail::stdout_range{}, args), ...);
}
@ -223,7 +223,7 @@ inline void writeln(A const &...args) {
template<typename ...A>
inline void writef(string_range fmt, A const &...args) {
format_spec sp{fmt, out.getloc()};
format_spec sp{fmt, cout.getloc()};
sp.format(detail::stdout_range{}, args...);
}