From 9a8c807d18ed66caa2d6b4d19224d4795c5ec3ed Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 20 Mar 2018 20:59:54 +0100 Subject: [PATCH] Core/Algorithm: Fix Apply problems --- ChangeLog.md | 1 + include/Nazara/Core/Algorithm.inl | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 93acf657a..4b0f87ff8 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -74,6 +74,7 @@ Nazara Engine: - Fixed Platform module not being classified as client-only - ⚠️ Renamed Bitset::Read to Bitset::Write - ⚠️ Added a type tag parameter to Serialize and Unserialize functions, to prevent implicit conversions with overloads +- Fixed Apply functions with complex return types Nazara Development Kit: - Added ImageWidget (#139) diff --git a/include/Nazara/Core/Algorithm.inl b/include/Nazara/Core/Algorithm.inl index 969c07bdd..2f9069f02 100644 --- a/include/Nazara/Core/Algorithm.inl +++ b/include/Nazara/Core/Algorithm.inl @@ -21,13 +21,13 @@ namespace Nz { // http://www.cppsamples.com/common-tasks/apply-tuple-to-function.html template - decltype(auto) ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence) + auto ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence) { return std::forward(fn)(std::get(std::forward(t))...); } template - decltype(auto) ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence) + auto ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence) { return (object .* std::forward(fn))(std::get(std::forward(t))...); }