mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-03 21:46:18 +00:00
Fix formatting
This commit is contained in:
parent
0e4278717b
commit
93d7cb12f1
@ -1413,8 +1413,7 @@ class utf8_to_utf16 {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// A converter from UTF-16/UTF-32 (host endian) to UTF-8.
|
// A converter from UTF-16/UTF-32 (host endian) to UTF-8.
|
||||||
template <typename WChar, typename Buffer = memory_buffer>
|
template <typename WChar, typename Buffer = memory_buffer> class to_utf8 {
|
||||||
class to_utf8 {
|
|
||||||
private:
|
private:
|
||||||
Buffer buffer_;
|
Buffer buffer_;
|
||||||
|
|
||||||
@ -4179,22 +4178,22 @@ FMT_API auto vsystem_error(int error_code, string_view format_str,
|
|||||||
format_args args) -> std::system_error;
|
format_args args) -> std::system_error;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
Constructs :class:`std::system_error` with a message formatted with
|
Constructs :class:`std::system_error` with a message formatted with
|
||||||
``fmt::format(fmt, args...)``.
|
``fmt::format(fmt, args...)``.
|
||||||
*error_code* is a system error code as given by ``errno``.
|
*error_code* is a system error code as given by ``errno``.
|
||||||
|
|
||||||
**Example**::
|
**Example**::
|
||||||
|
|
||||||
// This throws std::system_error with the description
|
// This throws std::system_error with the description
|
||||||
// cannot open file 'madeup': No such file or directory
|
// cannot open file 'madeup': No such file or directory
|
||||||
// or similar (system message may vary).
|
// or similar (system message may vary).
|
||||||
const char* filename = "madeup";
|
const char* filename = "madeup";
|
||||||
std::FILE* file = std::fopen(filename, "r");
|
std::FILE* file = std::fopen(filename, "r");
|
||||||
if (!file)
|
if (!file)
|
||||||
throw fmt::system_error(errno, "cannot open file '{}'", filename);
|
throw fmt::system_error(errno, "cannot open file '{}'", filename);
|
||||||
\endrst
|
\endrst
|
||||||
*/
|
*/
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
auto system_error(int error_code, format_string<T...> fmt, T&&... args)
|
auto system_error(int error_code, format_string<T...> fmt, T&&... args)
|
||||||
-> std::system_error {
|
-> std::system_error {
|
||||||
|
Loading…
Reference in New Issue
Block a user