Use a helper class so that the actual implementation is shared and
introduce a helper class for treating QStringList and other qt
containers in the same way.
There are now 2² overloads, because:
- member function pointer vs everything else
- same container type, different container types
Change-Id: I343ca7d4e0007f7146b2e646c436c22174e27779
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
- Works for all container types now, defaulting to
the same container type for input and output
- Enables specifying the result container type,
e.g. QSet<X> x = Utils::transform<QSet>(list, function);
- Use our own inserter instead of std::back_inserter,
to enable usage with QSet<>
Change-Id: I7256e51430bfc1409456c68b6ee270778b95e9d5
Reviewed-by: hjk <hjk121@nokiamail.com>
Qt 5.3 is the minimum requirement these days. Remove all fallback code
from sources and project files.
Change-Id: If6188a471197acadda4d6baee71804ba1a8026c6
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Fix logic around temporary qt versions. We want essentially shared
ownership of kits on the temporary qt version.
Change-Id: Ic8c748aa2b04afb5a30444563b3fc2f4272ca47c
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Msvc 2013 (with update 2) had problems with using the member variant of
Utils::equal in ToolChainModel::findToolChain. This patch removes the
Utils::equal variant and does a workaround in
ToolChainModel::findToolChain
Change-Id: Ib0717fe426e34763b912e4a73db266c56aa8c1dd
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Apparently g++ 4.7 has a broken implementation of std::is_convertible.
Change-Id: I2857b265dcd70d11ead00b45e2ba096606985e63
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Takes a member (function) pointer and a value and returns a functor,
that takes a instance of the mfp's class and returns whether it's equal
to value. Sounds complicated, but is a common pattern that is easy to
understand.
Change-Id: Iaaeb90488d34ddfd6940dadd4c66705381198fee
Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Add Utils::transform and anyOf that take a member function pointer.
Remove bestElementOr it's unused.
Use declval<T> in transform's return type, because msvc does evaluate
T() and for types that don't have simple constructor this fails.
Add std::remove_reference since decltype returns a reference for
lvalues.
Change-Id: I22248b226748eeb27af0d300182d574438d7f756
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
Makes test_modelmanager_extraeditorsupport_uiFiles pass again. Before, a
"CMake Wizard" dialog blocked the auto test due to the wrong
comparisons.
The std::max_element function takes a less predicate. Thus the right way
to find e.g. highest int in a vector is:
std::max_element(..., std::less<>) or
std::min_element(..., std::greater<>)
Both variants are confussing to read. Instead of provinding
Utils::maxElementOr provide a bestElementOr which leads to this code:
bestElementOr(..., std::greater<>).
Change-Id: Ic30f0d742c03170b28227f60d3a5ae00e40fdf5a
Reviewed-by: Daniel Teske <daniel.teske@digia.com>