From ed50041589974d31296cb30dc1897f7fba6336c2 Mon Sep 17 00:00:00 2001 From: B Stack Date: Wed, 20 Nov 2019 08:36:44 -0500 Subject: add upstream 10.18 --- zen/string_tools.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'zen/string_tools.h') diff --git a/zen/string_tools.h b/zen/string_tools.h index dcb5a54a..7f9a07ff 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -32,7 +32,7 @@ template Char asciiToLower(Char c); template Char asciiToUpper(Char c); //both S and T can be strings or char/wchar_t arrays or single char/wchar_t -template bool contains(const S& str, const T& term); +template >> bool contains(const S& str, const T& term); template bool startsWith (const S& str, const T& prefix); template bool startsWithAsciiNoCase(const S& str, const T& prefix); @@ -103,7 +103,6 @@ template T copyStringTo(S&& str); - //---------------------- implementation ---------------------- template inline bool isWhiteSpace(Char c) @@ -279,7 +278,7 @@ int compareAsciiNoCase(const S& lhs, const T& rhs) } -template inline +template inline bool contains(const S& str, const T& term) { static_assert(std::is_same_v, GetCharTypeT>); @@ -415,15 +414,15 @@ std::vector split(const S& str, const T& delimiter, SplitType st) namespace impl { -ZEN_INIT_DETECT_MEMBER(append); +ZEN_INIT_DETECT_MEMBER(append) //either call operator+=(S(str, len)) or append(str, len) -template inline -std::enable_if_t::value> stringAppend(S& str, InputIterator first, InputIterator last) { str.append(first, last); } +template >> inline +void stringAppend(S& str, InputIterator first, InputIterator last) { str.append(first, last); } //inefficient append: keep disabled until really needed -//template inline -//std::enable_if_t::value> stringAppend(S& str, InputIterator first, InputIterator last) { str += S(first, last); } +//template >> inline +//void stringAppend(S& str, InputIterator first, InputIterator last) { str += S(first, last); } } @@ -850,6 +849,8 @@ char unhexify(char high, char low) }; return static_cast(16 * unhexifyDigit(high) + unhexifyDigit(low)); //[!] convert to unsigned char first, then to char (which may be signed) } + + } #endif //STRING_TOOLS_H_213458973046 -- cgit