Revert "Core/Algorithm: Fix Apply problems"

This reverts commit 9a8c807d18.
This commit is contained in:
Lynix 2018-03-20 21:50:22 +01:00
parent a32408a4d7
commit 25f2bcf03f
2 changed files with 2 additions and 3 deletions

View File

@ -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)

View File

@ -21,13 +21,13 @@ namespace Nz
{
// http://www.cppsamples.com/common-tasks/apply-tuple-to-function.html
template<typename F, typename Tuple, size_t... S>
auto ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence<S...>)
decltype(auto) ApplyImplFunc(F&& fn, Tuple&& t, std::index_sequence<S...>)
{
return std::forward<F>(fn)(std::get<S>(std::forward<Tuple>(t))...);
}
template<typename O, typename F, typename Tuple, size_t... S>
auto ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence<S...>)
decltype(auto) ApplyImplMethod(O& object, F&& fn, Tuple&& t, std::index_sequence<S...>)
{
return (object .* std::forward<F>(fn))(std::get<S>(std::forward<Tuple>(t))...);
}