From 25f2bcf03fe3728a220374544dc200feb54900a1 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 20 Mar 2018 21:50:22 +0100 Subject: [PATCH] Revert "Core/Algorithm: Fix Apply problems" This reverts commit 9a8c807d18ed66caa2d6b4d19224d4795c5ec3ed. --- ChangeLog.md | 1 - include/Nazara/Core/Algorithm.inl | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 5a745b3fd..99b199f87 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -75,7 +75,6 @@ Nazara Engine: - ⚠️ Renamed Bitset::Read to Bitset::Write - Fixed ENetCompressor class destructor not being virtual - ⚠️ 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 2f9069f02..969c07bdd 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 - auto ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence) + decltype(auto) ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence) { return std::forward(fn)(std::get(std::forward(t))...); } template - auto ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence) + decltype(auto) ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence) { return (object .* std::forward(fn))(std::get(std::forward(t))...); }