xo-facet: bugfix: is_convertible_v usage

is_convertible_v<T,T> can be false if T isn't copyable.
since dealing with a T pointer, actually want
is_convertible_v<T*,T*>
This commit is contained in:
Roland Conybeare 2026-03-24 17:47:52 -04:00
commit 1b72597be0
2 changed files with 3 additions and 3 deletions

View file

@ -180,7 +180,7 @@ namespace xo {
* Either way need to force vtable replacement, hence memcpy here
*/
_launder_from(oother);
} else if constexpr (std::is_convertible_v<DRepr, DOther>) {
} else if constexpr (std::is_convertible_v<DRepr*, DOther*>) {
/* other is typed, consistently with *this */
this->from_data(oother.data());
} else
@ -189,7 +189,7 @@ namespace xo {
// + may fail at runtime
static_assert(std::is_same_v<DRepr, DVariantPlaceholder>
|| std::is_convertible_v<DRepr, DOther>);
|| std::is_convertible_v<DRepr*, DOther*>);
}
return *this;
}

View file

@ -102,7 +102,7 @@ namespace xo {
/** Retrieve facet implementation for a (facet,datatype) pair **/
template <typename AFacet, typename DRepr>
using FacetImplType = FacetImplementation<AFacet, DRepr>::ImplType;
using FacetImplType = typename FacetImplementation<AFacet, DRepr>::ImplType;
/** Use:
* auto iface = xo::facet::impl_for<AGCObject, DList>();