Core/Commands: Exclude ambigious cast operator overloads from command Variant

Closes #25618
This commit is contained in:
Shauren
2020-10-30 13:36:14 +01:00
parent 3c201b7554
commit b57530ebb1

View File

@@ -244,7 +244,8 @@ namespace Trinity::ChatCommands
namespace Trinity::Impl
{
template <typename T>
struct CastToVisitor {
struct CastToVisitor
{
template <typename U>
T operator()(U const& v) const { return v; }
};
@@ -273,7 +274,7 @@ namespace Trinity::ChatCommands
}
template<bool C = have_operators>
operator std::enable_if_t<C && std::is_convertible<first_type, size_t>::value, size_t>() const
operator std::enable_if_t<C && !std::is_same_v<first_type, size_t> && std::is_convertible_v<first_type, size_t>, size_t>() const
{
return operator*();
}