mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-27 23:37:04 -05:00
includes/std: Allow std::print() and std::format() to take any value as format argument again
This commit is contained in:
@@ -9,21 +9,21 @@ namespace auto std {
|
|||||||
/**
|
/**
|
||||||
Formats the given arguments using the format string and prints the result to the console
|
Formats the given arguments using the format string and prints the result to the console
|
||||||
This function uses the C++20 `std::format` or libfmt's `fmt::format` syntax.
|
This function uses the C++20 `std::format` or libfmt's `fmt::format` syntax.
|
||||||
@param fmt Format string
|
@param fmt Format string or any other value that can be converted to a string
|
||||||
@param args Values to use in the formatting
|
@param args Values to use in the formatting
|
||||||
*/
|
*/
|
||||||
fn print(str fmt, auto ... args) {
|
fn print(auto fmt, auto ... args) {
|
||||||
builtin::std::print(fmt, args);
|
builtin::std::print(fmt, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Formats the given arguments using the format string and returns the result as a string
|
Formats the given arguments using the format string and returns the result as a string
|
||||||
This function uses the C++20 `std::format` or libfmt's `fmt::format` syntax.
|
This function uses the C++20 `std::format` or libfmt's `fmt::format` syntax.
|
||||||
@param fmt Format string
|
@param fmt Format string or any other value that can be converted to a string
|
||||||
@param args Values to use in the formatting
|
@param args Values to use in the formatting
|
||||||
@return The formatted string
|
@return The formatted string
|
||||||
*/
|
*/
|
||||||
fn format(str fmt, auto ... args) {
|
fn format(auto fmt, auto ... args) {
|
||||||
return builtin::std::format(fmt, args);
|
return builtin::std::format(fmt, args);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user