Commit e818a4ed authored by Daniel Teske's avatar Daniel Teske
Browse files

Algorithm: Add a TODO for the future

Currently e.g. this won't compile:
Utils::equal(&Class::toString, QLatin1String("xxx"));

because eqaul_to<QLatin1String> doesn't know how to compare
QString and QLatin1String.

In C++14, equal_to<> (without any template parameter) was added,
which simply works in that case.

Change-Id: I463d01e23f9f0379fea95ef1de4305751af8f1a7
Reviewed-by: default avatarTobias Hunger <>
parent 33d1a91c
......@@ -147,6 +147,8 @@ template<typename R, typename S, typename T>
auto equal(R (S::*function)() const, T value)
-> decltype(std::bind<bool>(std::equal_to<T>(), value, std::bind(function, std::placeholders::_1)))
// This should use std::equal_to<> instead of std::eqaul_to<T>,
// but that's not supported everywhere yet, since it is C++14
return std::bind<bool>(std::equal_to<T>(), value, std::bind(function, std::placeholders::_1));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment