Make string support even more generic

Closes #2084
This commit is contained in:
David Gauchard
2024-05-01 13:59:55 +02:00
committed by Benoit Blanchon
parent c99af48e97
commit 57354de831
2 changed files with 4 additions and 4 deletions

View File

@ -5,6 +5,7 @@ HEAD
----
* Improve error messages when using `char` or `char*` (issue #2043)
* Make string support even more generic (PR #2084 by @d-a-v)
v6.21.5 (2024-01-10)
-------

View File

@ -38,16 +38,15 @@ struct has_data<T,
const char*>::value>::type>
: true_type {};
// size_t length() const
// unsigned int length() const
// - String
template <class T, class = void>
struct has_length : false_type {};
template <class T>
struct has_length<
T, typename enable_if<
is_same<decltype(declval<const T>().length()), size_t>::value>::type>
struct has_length<T, typename enable_if<is_unsigned<
decltype(declval<const T>().length())>::value>::type>
: true_type {};
// size_t size() const