add fS function to simplify string formatting with fmt::format

This commit is contained in:
Rasmus Karlsson 2017-12-17 17:01:37 +01:00
parent 54ed42f884
commit 02e5030475
2 changed files with 15 additions and 1 deletions

View file

@ -170,7 +170,8 @@ HEADERS += \
src/widgets/splitcontainer.hpp \
src/widgets/helper/droppreview.hpp \
src/widgets/helper/splitcolumn.hpp \
src/util/irchelpers.hpp
src/util/irchelpers.hpp \
src/util/helpers.hpp
PRECOMPILED_HEADER =

13
src/util/helpers.hpp Normal file
View file

@ -0,0 +1,13 @@
#pragma once
#include <fmt/format.h>
namespace chatterino {
template <typename... Args>
auto fS(Args &&... args) -> decltype(fmt::format(std::forward<Args>(args)...))
{
return fmt::format(std::forward<Args>(args)...);
}
} // namespace chatterino