Library: sharpen detection of string conversion cases
the metafunction `is_basically<X>` performed only an equality match, while, given it's current usage, it should also include a subtype-interface-match. This changes especially the `is_StringLike<S>` metafunction, both on const references and on classes built on top of string or string_view.
This commit is contained in:
parent
be4d809a23
commit
b029c308f9
2 changed files with 12 additions and 5 deletions
|
|
@ -308,7 +308,7 @@ namespace meta {
|
|||
|
||||
/** compare unadorned types, disregarding const and references */
|
||||
template<typename T, typename U>
|
||||
struct is_basically
|
||||
struct is_basicallySame
|
||||
: is_same <typename Strip<T>::TypeReferred
|
||||
,typename Strip<U>::TypeReferred>
|
||||
{ };
|
||||
|
|
@ -323,6 +323,13 @@ namespace meta {
|
|||
, is_same<I,S>
|
||||
>
|
||||
{ };
|
||||
|
||||
/** compare for unadorned base type, disregarding const and references */
|
||||
template<typename S, typename I>
|
||||
struct is_basically
|
||||
: is_Subclass <typename Strip<S>::TypeReferred
|
||||
,typename Strip<I>::TypeReferred>
|
||||
{ };
|
||||
|
||||
/** verify the first (special) type can stand-in for the second */
|
||||
template<typename S, typename G>
|
||||
|
|
|
|||
|
|
@ -251,13 +251,13 @@ out-lit: can_lexical2string<StringRRef> : Yes
|
|||
out-lit: can_convertToString<StringRRef> : Yes
|
||||
out-lit: use_StringConversion4Stream<StringRRef> : No
|
||||
out-lit: Type: StrConstRef ......
|
||||
out-lit: is_StringLike<StrConstRef> : No
|
||||
out-lit: BasicallyString<StrConstRef> : No
|
||||
out-lit: is_StringLike<StrConstRef> : Yes
|
||||
out-lit: BasicallyString<StrConstRef> : Yes
|
||||
out-lit: BasicallyCString<StrConstRef> : No
|
||||
out-lit: std::is_arithmetic<StrConstRef> : No
|
||||
out-lit: can_lexical2string<StrConstRef> : No
|
||||
out-lit: can_lexical2string<StrConstRef> : Yes
|
||||
out-lit: can_convertToString<StrConstRef> : Yes
|
||||
out-lit: use_StringConversion4Stream<StrConstRef> : Yes
|
||||
out-lit: use_StringConversion4Stream<StrConstRef> : No
|
||||
out-lit: Type: CharLit ......
|
||||
out-lit: is_StringLike<CharLit> : Yes
|
||||
out-lit: BasicallyString<CharLit> : No
|
||||
|
|
|
|||
Loading…
Reference in a new issue