diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 16:13:08 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-07 16:22:35 -0700 |
| commit | 285bbe0d8a1a14afc217b06790e1c99e1200a14b (patch) | |
| tree | f97a1e361da3995056f4859b5448f2b17f19019d /toolsrc/include | |
| parent | e8dbe3ec4c6b15030bbc8d79162a04c69e06482f (diff) | |
| download | vcpkg-285bbe0d8a1a14afc217b06790e1c99e1200a14b.tar.gz vcpkg-285bbe0d8a1a14afc217b06790e1c99e1200a14b.zip | |
Add to_printf_arg() for classes with to_string()
Diffstat (limited to 'toolsrc/include')
| -rw-r--r-- | toolsrc/include/vcpkg_Strings.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/toolsrc/include/vcpkg_Strings.h b/toolsrc/include/vcpkg_Strings.h index 03b16975e..7b031608c 100644 --- a/toolsrc/include/vcpkg_Strings.h +++ b/toolsrc/include/vcpkg_Strings.h @@ -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(); |
