From eecd4e5ba96244be15e3be9a9a4d404c36a533c7 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 18 Jan 2022 23:25:48 +0800 Subject: ... --- include/cru/common/Format.hpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/cru/common/Format.hpp b/include/cru/common/Format.hpp index d53a5720..c093c9e6 100644 --- a/include/cru/common/Format.hpp +++ b/include/cru/common/Format.hpp @@ -2,6 +2,7 @@ #include "Exception.hpp" #include "String.hpp" +#include "cru/common/Base.hpp" namespace cru { inline String ToString(bool value) { @@ -32,16 +33,14 @@ std::enable_if_t, String> ToString(T value) { return String(str.cbegin(), str.cend()); } +inline String ToString(String value) { return value; } + template -std::enable_if_t< - std::is_convertible_v)), String>, - String> -ToString(const T& value, StringView option) { - return ToString(value); +String ToString(T&& value, StringView option) { + CRU_UNUSED(option) + return ToString(std::forward(value)); } -inline String ToString(String value) { return value; } - namespace details { enum class FormatTokenType { PlaceHolder, Text }; enum class FormatPlaceHolderType { None, Positioned, Named }; -- cgit v1.2.3