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:
parent
b37423d13a
commit
1b72597be0
2 changed files with 3 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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>();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue