30#define _GLIBCXX_PRINT 1
33#pragma GCC system_header
38#define __glibcxx_want_print
52#ifndef _GLIBCXX_NO_INLINE_PRINT
56namespace std _GLIBCXX_VISIBILITY(default)
58_GLIBCXX_BEGIN_NAMESPACE_VERSION
61 vprint_nonunicode(FILE* __stream, string_view __fmt, format_args __args);
64 vprint_nonunicode_buffered(FILE* __stream, string_view __fmt,
68 vprint_unicode(FILE* __stream, string_view __fmt, format_args __args);
71 vprint_unicode_buffered(FILE* __stream, string_view __fmt,
75 vprint_unicode_buffered(string_view __fmt, format_args __args);
78 vprint_nonunicode_buffered(string_view __fmt, format_args __args);
80 template<
typename... _Args>
82 print(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args)
84 constexpr bool __locksafe =
85 (enable_nonlocking_formatter_optimization<remove_cvref_t<_Args>> && ...);
87 auto __fmtargs = std::make_format_args(__args...);
88#if defined(_WIN32) && !defined(__CYGWIN__)
89 if constexpr (__unicode::__literal_encoding_is_utf8())
90 std::vprint_unicode_buffered(__stream, __fmt.get(), __fmtargs);
94 if constexpr (__locksafe)
95 std::vprint_nonunicode(__stream, __fmt.get(), __fmtargs);
97 std::vprint_nonunicode_buffered(__stream, __fmt.get(), __fmtargs);
100 template<
typename... _Args>
102 print(format_string<_Args...> __fmt, _Args&&... __args)
105 template<
typename... _Args>
107 println(FILE* __stream, format_string<_Args...> __fmt, _Args&&... __args)
109 constexpr bool __locksafe =
110 (enable_nonlocking_formatter_optimization<remove_cvref_t<_Args>> && ...);
117 auto __fmtargs = std::make_format_args(__args...);
119#if defined(_WIN32) && !defined(__CYGWIN__)
120 if constexpr (__unicode::__literal_encoding_is_utf8())
125 __fmtn.reserve(__fmt.get().size() + 1);
126 __fmtn = __fmt.get();
128 std::vprint_unicode_buffered(__stream, __fmtn, __fmtargs);
133#ifdef _GLIBCXX_NO_INLINE_PRINT
136 __fmtn.reserve(__fmt.get().size() + 1);
137 __fmtn = __fmt.get();
139 std::vprint_nonunicode(__stream, __fmtn, __fmtargs);
146 if constexpr (__locksafe)
147 std::vformat_to(__format::_File_sink(__stream,
true).out(),
148 __fmt.get(), __fmtargs);
153 __format::_Str_sink<char> __buf;
154 std::vformat_to(__buf.out(), __fmt.get(), __fmtargs);
155 string_view __s(__buf.view());
156 __format::_File_sink(__stream,
true).out() = __s;
161 template<
typename... _Args>
163 println(format_string<_Args...> __fmt, _Args&&... __args)
167 vprint_unicode_buffered(string_view __fmt, format_args __args)
168 { std::vprint_unicode_buffered(stdout, __fmt, __args); }
171 vprint_nonunicode_buffered(string_view __fmt, format_args __args)
172 { std::vprint_nonunicode_buffered(stdout, __fmt, __args); }
175 inline void println(FILE* __stream)
177#if defined(_WIN32) && !defined(__CYGWIN__)
178 if constexpr (__unicode::__literal_encoding_is_utf8())
179 std::vprint_unicode_buffered(__stream,
"\n", std::make_format_args());
182 if (std::putc(
'\n', __stream) == EOF)
183 __throw_system_error(EIO);
186 inline void println() { std::println(stdout); }
188_GLIBCXX_END_NAMESPACE_VERSION
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.