Fixed trait so "compare" is properly called

This commit is contained in:
Klaus Basan
2018-05-11 05:28:50 +02:00
parent 0f9b275f52
commit 60ad3d9c2b
2 changed files with 3 additions and 3 deletions

View File

@@ -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>());
};
}

View File

@@ -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
/*!