Revert "Core/Algorithm: Fix Apply problems"
This reverts commit 9a8c807d18.
This commit is contained in:
parent
a32408a4d7
commit
25f2bcf03f
|
|
@ -75,7 +75,6 @@ Nazara Engine:
|
||||||
- ⚠️ Renamed Bitset::Read to Bitset::Write
|
- ⚠️ Renamed Bitset::Read to Bitset::Write
|
||||||
- Fixed ENetCompressor class destructor not being virtual
|
- Fixed ENetCompressor class destructor not being virtual
|
||||||
- ⚠️ Added a type tag parameter to Serialize and Unserialize functions, to prevent implicit conversions with overloads
|
- ⚠️ 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:
|
Nazara Development Kit:
|
||||||
- Added ImageWidget (#139)
|
- Added ImageWidget (#139)
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,13 @@ namespace Nz
|
||||||
{
|
{
|
||||||
// http://www.cppsamples.com/common-tasks/apply-tuple-to-function.html
|
// http://www.cppsamples.com/common-tasks/apply-tuple-to-function.html
|
||||||
template<typename F, typename Tuple, size_t... S>
|
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))...);
|
return std::forward<F>(fn)(std::get<S>(std::forward<Tuple>(t))...);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename O, typename F, typename Tuple, size_t... S>
|
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))...);
|
return (object .* std::forward<F>(fn))(std::get<S>(std::forward<Tuple>(t))...);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue