From de7d12974ff196369d11ed93d59ffd84dec71465 Mon Sep 17 00:00:00 2001 From: PotatosFish Date: Tue, 10 Apr 2018 19:22:11 -0500 Subject: [PATCH] Added support for custom types with 'toString' function --- include/fmt/core.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/fmt/core.h b/include/fmt/core.h index 98c5316c..3f5e7307 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -629,12 +629,19 @@ inline typename std::enable_if< template inline typename std::enable_if< + !std::is_same::value && !convert_to_int::value && !std::is_convertible>::value && !std::is_convertible>::value, typed_value>::type make_value(const T &val) { return val; } +template +inline typename std::enable_if< + std::is_same::value, + typed_value>::type + make_value(const T& val) {return static_cast>(val.toString());} + template typed_value make_value(const named_arg &val) {