Add to_printf_arg() for classes with to_string()

This commit is contained in:
Alexander Karatarakis 2017-04-07 16:13:08 -07:00
parent e8dbe3ec4c
commit 285bbe0d8a

View File

@ -5,6 +5,12 @@
namespace vcpkg::Strings::details
{
template<class T>
auto to_printf_arg(const T& t) -> decltype(t.to_string())
{
return t.to_string();
}
inline const char* to_printf_arg(const std::string& s)
{
return s.c_str();