mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Fixed trait so "compare" is properly called
This commit is contained in:
@@ -241,7 +241,7 @@ namespace BlackMisc
|
||||
return [index = *this](const auto & a, const auto & b)
|
||||
{
|
||||
using T = std::decay_t<decltype(a)>;
|
||||
return Private::compareByProperty(a, b, index, THasCompareByPropertyIndex<T>(), THasPropertyByIndex<T>());
|
||||
return Private::compareByProperty(a, b, index, THasComparePropertyByIndex<T>(), THasPropertyByIndex<T>());
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -164,10 +164,10 @@ namespace BlackMisc
|
||||
* and i is an instance of CPropertyIndex.
|
||||
*/
|
||||
template <typename T, typename = void_t<>>
|
||||
struct THasCompareByPropertyIndex : public std::false_type {};
|
||||
struct THasComparePropertyByIndex : public std::false_type {};
|
||||
//! \cond
|
||||
template <typename T>
|
||||
struct THasCompareByPropertyIndex<T, void_t<decltype(std::declval<T>().compareByPropertyIndex(std::declval<CPropertyIndex>(), std::declval<T>()))>> : public std::true_type {};
|
||||
struct THasComparePropertyByIndex<T, void_t<decltype(std::declval<T>().comparePropertyByIndex(std::declval<const CPropertyIndex &>(), std::declval<const T &>()))>> : public std::true_type {};
|
||||
//! \endcond
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user