rename standard streams to feel less keywordy
This commit is contained in:
parent
3c33395fe6
commit
60cc9ee47e
|
@ -137,7 +137,7 @@ int main() {
|
||||||
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF
|
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF
|
||||||
);
|
);
|
||||||
std::locale::global(std::locale{""});
|
std::locale::global(std::locale{""});
|
||||||
out.imbue(std::locale{});
|
cout.imbue(std::locale{});
|
||||||
writefln("\n-- number format with system locale --");
|
writefln("\n-- number format with system locale --");
|
||||||
writefln(
|
writefln(
|
||||||
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF
|
"\"%d\", \"%f\", \"%X\"", 123456789, 12345.6789123, 0x123456789ABCDEF
|
||||||
|
|
10
ostd/io.hh
10
ostd/io.hh
|
@ -168,9 +168,9 @@ inline void swap(file_stream &a, file_stream &b) {
|
||||||
a.swap(b);
|
a.swap(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static file_stream in(stdin);
|
static file_stream cin{stdin};
|
||||||
static file_stream out(stdout);
|
static file_stream cout{stdout};
|
||||||
static file_stream err(stderr);
|
static file_stream cerr{stderr};
|
||||||
|
|
||||||
/* no need to call anything from file_stream, prefer simple calls... */
|
/* no need to call anything from file_stream, prefer simple calls... */
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ namespace detail {
|
||||||
|
|
||||||
template<typename ...A>
|
template<typename ...A>
|
||||||
inline void write(A const &...args) {
|
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), ...);
|
(sp.format_value(detail::stdout_range{}, args), ...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,7 +223,7 @@ inline void writeln(A const &...args) {
|
||||||
|
|
||||||
template<typename ...A>
|
template<typename ...A>
|
||||||
inline void writef(string_range fmt, A const &...args) {
|
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...);
|
sp.format(detail::stdout_range{}, args...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue