mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-18 16:53:02 +08:00
Add to_printf_arg() for classes with to_string()
This commit is contained in:
parent
e8dbe3ec4c
commit
285bbe0d8a
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user