This reverts commit ba24125cbfdbe78b48e8000ee6030f0d81a86491. The funImpl() functions were specifically designed to be sharable between the fun(key) and fun(key, def) overloads. Making the return statement a template argument turns one function into two, duplicating the executable code. It doesn't even improve readability much, so revert to returning pointers as a poor-man's optional<>. This re-SCARY-fies the functions, also adapting the code of the heterogeneous lookup additions that were introduced later. An alternative would have been to use qxp::function_ref, but that produces a lot of code itself, as the recent removal of it from QtTest has shown, and it's not required, either. KISS applies: the old return-by-pointer was the most simple implementation possible. There is no need for a type-erasing function wrapper here. Change-Id: I8570ce5acd6d6e98321e4003919651cd97cad83e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit cdc04b96dd8a69d0310e1474008b48128d050450) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%