Switch to C++20
This commit is contained in:
@@ -19,9 +19,24 @@
|
||||
|
||||
namespace ImGui
|
||||
{
|
||||
template <typename T, typename... Args>
|
||||
IMGUI_API void TextFmt(T&& fmt, const Args &... args) {
|
||||
std::string str = fmt::format(std::forward<T>(fmt), args...);
|
||||
template <typename... Args>
|
||||
void TextFmt(const std::string_view& fmt, const Args&... args)
|
||||
{
|
||||
std::string str = fmt::format(fmt::runtime(fmt), (args)...);
|
||||
ImGui::TextUnformatted(str.data(), str.data() + str.size());
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void TextFmt(const std::string_view& fmt, Args&&... args)
|
||||
{
|
||||
std::string str = fmt::format(fmt::runtime(fmt), std::forward<Args>(args)...);
|
||||
ImGui::TextUnformatted(str.data(), str.data() + str.size());
|
||||
}
|
||||
|
||||
template <const char* FMT, typename... Args>
|
||||
IMGUI_API void TextFmt(Args &&... args)
|
||||
{
|
||||
std::string str = fmt::format(FMT, std::forward<Args>(args)...);
|
||||
ImGui::TextUnformatted(str.data(), str.data() + str.size());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user