ΒΆtemplate <typename... T>
auto system_error(int error_code,
format_string<T...> fmt,
T&&... args)
-> std::system_error
template <typename... T>
auto system_error(int error_code,
format_string<T...> fmt,
T&&... args)
-> std::system_error
Description
\rstConstructs :class:`std::system_error` with a message formatted with ``fmt::format(fmt, args...)``. error_code* is a system error code as given by ``errno``. *Example**:: // This throws std::system_error with the description // cannot open file 'madeup': No such file or directory // or similar (system message may vary). const char* filename = "madeup"; std::FILE* file = std::fopen(filename, "r"); if (!file) throw fmt::system_error(errno, "cannot open file '{}'", filename);\endrst
Declared at: third_party/fmt/include/fmt/format.h:3964
Templates
- T
Parameters
- int error_code
- format_string<T...> fmt
- T&&... args